HELP: Policy is changed when deployed: autogen-* is added somehow #264
Replies: 2 comments 1 reply
-
Current summary: There's a difference in applying policies via yaml files and the helm charts. Thanks @chipzoller, I've seen that and now understands why the autogen rules are created. I think I know why I was confused... Here's what happens:
This causes the generated policy to be:
As you can see the excludes are copied to all the autogen-* rules. On the other hand, if I apply policies via helm (helm install kyverno-policies --namespace kyverno kyverno/kyverno-policies -f ~/kyverno-policies-values.yaml) and the values file contains:
That causes the generated policy to be:
As you can see, the exclude is not copied to all rules, which makes this policy fail on deployments in these namespaces. Should I create an issue instead of this discussion? Best regards |
Beta Was this translation helpful? Give feedback.
-
Hello everybody!
I'm unsure if it's an error or me not knowing what happens when deploying a policy!
Summary: Where does the autogen-* rules come from? And how do we configure the exclude part to them??
(Among many other policies) I've deployed: disallow-capabilities-strict. It's yaml looks like this:
It has two rules: require-drop-all and adding-capabilities-strict. Both of them matching kind: Pod.
But when I do a kubectl get clusterpolicy disallow-capabilities-strict -o yaml I get the following yaml configuration:
As you can see it suddenly has 6 rules, namely require-drop-all, adding-capabilities-strict as well as autogen-require-drop-all, autogen-cronjob-require-drop-all, autogen-adding-capabilities-strict, autogen-cronjob-adding-capabilities-strict.
Where does the autogen-* rules come from? And how do we configure the exclude part to them??
Thanks for your answers! :-)
Best regards
Jesper Berggren
Beta Was this translation helpful? Give feedback.
All reactions