GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
897 stars 231 forks source link

webhooks customization should expose `namespaceSelector` #1693

Open wrdls opened 6 months ago

wrdls commented 6 months ago

Checklist

Describe the feature or resource

We want to fully exclude system namespace like kube-system as well as other critical namespaces like istio-system from certain webhooks to ensure cluster stability.

See the GKE docs on this: https://cloud.google.com/kubernetes-engine/docs/how-to/optimize-webhooks#unsafe-webhooks

Additional information

Example of how this feature could look like

apiVersion: customize.core.cnrm.cloud.google.com/v1beta1
kind: ValidatingWebhookConfigurationCustomization
metadata:
  name: validating-webhook
spec:
  webhooks:
    - name: deny-immutable-field-updates
      namespaceSelector:
        matchExpressions:
          - key: kubernetes.io/metadata.name
            operator: NotIn
            values:
              - kube-system
              - kube-node-lease

Importance

This is highly important for us to consider Config Connector as a serious option to run in our production environments.

cheftako commented 6 months ago

@nicslatts