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

Scale Deployment to Zero Policy issue #1219

Open
VegardEikenes opened this issue Jan 15, 2025 · 0 comments
Open

Scale Deployment to Zero Policy issue #1219

VegardEikenes opened this issue Jan 15, 2025 · 0 comments

Comments

@VegardEikenes
Copy link

VegardEikenes commented Jan 15, 2025

I have tried to implement this policy in my cluster:
https://kyverno.io/policies/other/scale-deployment-zero/scale-deployment-zero/

It seems to work just fine when the restarting pod has 1 container. However, if the restarting pod has more than 1 container, i get this error:

ERR github.com/kyverno/kyverno/pkg/background/mutate/mutate.go:180 > error="failed to mutate existing resource, rule annotate-deployment-rule, response error: failed to evaluate preconditions: failed to substitute variables in condition key: failed to resolve sum(request.object.status.containerStatuses[*].restartCount || [0]) at path : JMESPath query failed: JMESPath function 'sum': invalid operand"

The policy should be adapted to work with more than just 1 container, and sum the restartcount of every container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant