Inspired by: https://dev.to/ineedale/writing-a-very-basic-kubernetes-mutating-admission-webhook-5b1
- Install Kubectl
- Install Kind
- Install docker
- Create cluster:
./kind-with-local-registry.sh
## Verify local registy is working
docker pull gcr.io/google-samples/hello-app:1.0
docker tag gcr.io/google-samples/hello-app:1.0 localhost:5001/hello-app:1.0
docker push localhost:5001/hello-app:1.0
kubectl create deployment hello-server --image=localhost:5001/hello-app:1.0
## Verify deployment comes up
kubectl delete deployment hello-server
- Create webhook TLS artifacts
./ssl/gen_tls.sh
- Update mutating webhook manifest
## Copy this output and paste into manifest CaBundle section
cat ca.crt | base64 | tr -d '\n'
- Apply mutating webhook
kubectl apply -f manifests/mutatig-webhook.yaml
- Build Container and deploy
docker build -t localhost:5001/demo:1.0.0 -f Dockerfile .
docker push localhost:5001/demo:1.0.0
- Test webhook
kubectl apply -f manifests/test