You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
Expected behavior
The policy should scale the deployment to zero when pods go above the selected threshold for restarts, also when the pods have more than 1 container.
The text was updated successfully, but these errors were encountered:
VegardEikenes
changed the title
Scale Deployment to Zero Policy issue
[BUG] Scale Deployment to Zero Policy issue
Feb 24, 2025
VegardEikenes
changed the title
[BUG] Scale Deployment to Zero Policy issue
[BUG] Scale Deployment to Zero Policy not working as expected
Feb 24, 2025
Kyverno Version
1.13.1
Kubernetes Version
1.29
Kubernetes Platform
AKS
Description
I have tried to implement this policy:
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"
Expected behavior
The policy should scale the deployment to zero when pods go above the selected threshold for restarts, also when the pods have more than 1 container.
The text was updated successfully, but these errors were encountered: