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-tls
in theadmissions
namespace. - The
admissions-webhook
deployment & service in theadmissions
namespace. - Two validating webhook configurations;
pods
andnamespaces
.
docker
envsubst
(on OSX can be installed withbrew install gettext
)