Skip to content

Kubernetes admission webhook for SparkApplication. Infrastructer layer configuration for sparkapp

Notifications You must be signed in to change notification settings

aagumin/sparkapp-k8s-webhook

Repository files navigation

Spark Application admission webhook.

MIT License Go Report Card

Kubernetes mutation webhook for SparkApplicaton. Mutate spark application upon creation.

For what?

  • Hiding the complexity of changing the environment when developing an application
  • Automatic setting of important properties
  • Easier CRD configuration based on annotations your team is familiar with
  • I want

Features

  • Set toleration and affinity based on team key.
  • Auto monitoring
  • Auto spark history server

Deployment

To deploy this project run

  helm repo add //TODO
  helm install awesome-webhook -n ${ns-with-spark-job}

Usage/Examples

kubectl apply -f examples/spark-pi.yaml -n ${ns-with-spark-job}

Documentation

Basic flow creation k8s resource with webhooks

webhook.svg

Helm Chart docs

Run Locally (dev)

Pre-requisites

  • Clone this repository
  • Golang >= 1.22
  • Openssl
  • (Optional) Kind | Minikube | k3s with Helm

Generate dev certs

   ./dev/gencerts.sh   

Go to the project directory

  go build -o dist/webhook github.com/aagumin/sparkapp-k8s-webhook

Start hook

  ./dist/webhook --cfgPath=examples/feature-flag.yaml --tls-cert=localhost.crt --tls-key=localhost.key

Test working

  ./dev/mutate_test.sh | jq .response.patch | sed 's/^.//;s/.$//' | base64 --decode

About

Kubernetes admission webhook for SparkApplication. Infrastructer layer configuration for sparkapp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published