The application could be created in any language. Go is the obvious choice since it's the language Kubernetes was built into.
App Logic consists of the following:
- Webserver listening on a given port.
- It receives an AdmissionReview request.
- It unloads this payload and expects to find a Deployment
- It exists if
Deployment.Spec.Replicas
are more than one - If sends an error message otherwise
Run the application:
go run . --cert certs/app.crt --key certs/app.key -logtostderr
It would show the following message:
I0325 22:25:24.278482 716010 main.go:53] Server running listening in port: 9000