Kubernetes mutation webhook for SparkApplicaton. Mutate spark application upon creation.
- 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
- Set toleration and affinity based on team key.
- Auto monitoring
- Auto spark history server
To deploy this project run
helm repo add //TODO
helm install awesome-webhook -n ${ns-with-spark-job}
kubectl apply -f examples/spark-pi.yaml -n ${ns-with-spark-job}
Basic flow creation k8s resource with webhooks
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