To temporarily disable the Admission Controller, for testing and troubleshooting, you can run these commands in your K8s cluster to:
-
Get the current kong-kong-validations configuration and save it to a file, kong-validations.yaml:
kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io kong-kong-validations -o yaml > kong-validations.yaml
-
Delete the kong-kong-validations webhook configuration:
kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io kong-kong-validations
To enable the Admission Controller again you can recover from the file created in previous step:
kubectl apply -f kong-validations.yaml
Note: this only fully disables admission control if the deleted ValidatingWebhookConfiguration is the only Kong-related one in the cluster. Kubernetes invokes every ValidatingWebhookConfiguration that matches a given resource, not just the one belonging to a particular KIC release. If there is more than one KIC installation in the cluster, each with its own webhook configuration, you must delete all of the matching webhook configurations to actually let an otherwise-invalid config through - deleting just one release’s configuration will not do it, since the others will still intercept the request.
More information about the Admission Controller can be found in the Admission Controller documentation.