Gatekeeper Constraint not blocking the non - whitelisted image #449
-
Hi We are using eks version 1.24 , Deployed gatekeeper via helm chart successfully into cluster. Now added Constraint template with rego policy to allow only whitelisted images into pod as yaml file as part of helm chart. below is the code
After that added Constraint crd policy for whitelist images via below yaml file deployed through helm chart as well.
Both Template and constraint were successful , verified by using the commands kubectl get constrainttemplate,constraint and also described and checked as well. Now to test this I created a pod with image: busybox and its not whitelisted : below is the yaml file
The pod is getting created , Actual behaviour should block this image and throw a error has invalid image Please, contact your DevOps. Follow the whitelisted image Can someone please help me with it ? Many thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
The policy itself works as intended: https://play.openpolicyagent.org/p/1KGD25rK3N Must be something missing in the configuration, or how it's set up. Not sure what that would be though. |
Beta Was this translation helpful? Give feedback.
Removing ignore label from default namespace resolves the issue and namespace where admission controller is deployed, policy wont work/applied in that namespace.