This is an example of setting up a ValidatingWebhookConfiguration using a locally (ie same k8s-cluster) hosted webhook server. It will create a fully functional admission-controller that validates namespaces and pods using the namespace/label checking api and the pod/probe checking api respectively.
Running ./setup.sh which will create the following resources in your cluster:
- The TLS secret for the server,
admissions-webhook-tlsin theadmissionsnamespace. - The
admissions-webhookdeployment & service in theadmissionsnamespace. - Two validating webhook configurations;
podsandnamespaces.
dockerenvsubst(on OSX can be installed withbrew install gettext)