Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gke Autopilot/Standard cluster warns about gatekeeper validating webhhok permissions #3046

Closed
btwseeu78 opened this issue Oct 9, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@btwseeu78
Copy link

We found when gatekeeper validation/mutationwebhook has kube-system/kube-node-lease or any of them enabled a supported scope we are warned by gke as warning. For our autopilot cluster the issue is much more severe since it does not allow provide manual as well automatic patches by post install jobs to modify/patch these namespaces. so we have only option to use default k8s labels, like name based labels.

As of now we only use Release namespace as default excluded namespaces list. we need to enable support template it to add other namespaces as we need.

Environment:

  • Gatekeeper version:
  • Kubernetes version: (use kubectl version): v1.27.3 GKE
@btwseeu78
Copy link
Author

duplicate to : #3038

@Markieta
Copy link

Markieta commented Oct 10, 2023

@btwseeu78 for those namespace warnings you may exempt them from being intercepted as well. For example with Helm values:

mutatingWebhookExemptNamespacesLabels:
  kubernetes.io/metadata.name:
    - kube-node-lease
    - kube-system
validatingWebhookExemptNamespacesLabels:
  kubernetes.io/metadata.name:
    - kube-node-lease
    - kube-system

@btwseeu78
Copy link
Author

I think we already have the key for name and it's value as release.namespaces.

Would not it be duplicate key in label selector. Need to check , I did with exempting them fin using label namespace post install job, autopilot is easy it has mutation to patch these namespaces automatically.

@Markieta
Copy link

I don't think it's an issue because matchExpressions takes a list, not a map. So I don't see an issue with reusing the key kubernetes.io/metadata.name here with a list of additional namespaces to exempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants