You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating and managing webhook resources like certificates and coordinating the kube-webhook-certgenJob to properly update the webhook's caBundle has proven to be difficult and unreliable.
This setup has already caused issues for a number of users (internal and external):
Migrate away from ValidatingWebhookConfiguration and managing certificates and kube-webhook-certgenJob, towards using ValidatingWebhookPolicy and ValidatingWebhookPolicyBindings which will be deployed as part of KGO's helm chart.
// +kubebuilder:validation:XValidation:message="Each port from spec.network.services.ingress.ports has to have an accompanying port in KONG_PORT_MAPS env",rule="self.spec.network.services.ingress.ports.all(p, self.spec.deployment.podTemplateSpec.spec.containers.filter(c, c.name == 'proxy')[0].env.filter(e, e.name == 'KONG_PORT_MAPS')[0].value.split(',').exists(pm, pm.split(':')[1] == string(p.targetPort)))"
yields the following
The CustomResourceDefinition "dataplanes.gateway-operator.konghq.com" is invalid:
* spec.validation.openAPIV3Schema.x-kubernetes-validations[1].rule: Forbidden: estimated rule cost exceeds budget by factor of more than 100x (try simplifying the rule, or adding maxItems, maxProperties, and maxLength where arrays, maps, and strings are declared)
* spec.validation.openAPIV3Schema.x-kubernetes-validations[1].rule: Forbidden: contributed to estimated rule cost total exceeding cost limit for entire OpenAPIv3 schema
* spec.validation.openAPIV3Schema: Forbidden: x-kubernetes-validations estimated rule cost total for entire OpenAPIv3 schema exceeds budget by factor of more than 100x (try simplifying the rule, or adding maxItems, maxProperties, and maxLength where arrays, maps, and strings are declared)
validatingadmissionpolicy.admissionregistration.k8s.io/ports.dataplane.gateway-operator.konghq.com configured
validatingadmissionpolicybinding.admissionregistration.k8s.io/binding-ports.dataplane.gateway-operator.konghq.com unchanged
The dataplanes "dataplane-example" is invalid: : ValidatingAdmissionPolicy 'ports.dataplane.gateway-operator.konghq.com' with binding 'binding-ports.dataplane.gateway-operator.konghq.com' denied request: Each ports from spec.network.services.ingress.ports has to have an accompanying port in KONG_PORT_MAPS env
The text was updated successfully, but these errors were encountered:
Problem statement
Creating and managing webhook resources like certificates and coordinating the
kube-webhook-certgen
Job
to properly update the webhook'scaBundle
has proven to be difficult and unreliable.This setup has already caused issues for a number of users (internal and external):
Fail
failure policy in ControlPlane's validating webhook configuration #122Proposed solution
Migrate away from
ValidatingWebhookConfiguration
and managing certificates andkube-webhook-certgen
Job
, towards usingValidatingWebhookPolicy
andValidatingWebhookPolicyBinding
s which will be deployed as part of KGO's helm chart.All the rules that are currently defined in
are either trivial to implement at CEL expressions on CRDs or through CEL expressions in
ValidatingAdmissionPolicy
.Some rules would be more complex than the others and would require to be added as the latter, e.g. validation of
KONG_PORT_MAPS
andKONG_PROXY_LISTEN
againstDataPlane
's `spec.network.services.ingress.ports, when added as CRD CEL expression:yields the following
But works when implemented as:
The text was updated successfully, but these errors were encountered: