Interview Prep/Helm/Install & Upgrade Failures

`Error: INSTALLATION FAILED: admission webhook "validate.kyverno.svc-fail" denied the request: resource Deployment/shop/shop-api was blocked due to the following policies require-run-as-nonroot: ...`

IntermediateTroubleshootingInstall & Upgrade Failures
Answer

Likely causes → The rendered manifest violates a cluster policy (Kyverno, Gatekeeper, Pod Security Admission).

Diagnose →

helm template shop ./shop -f values-prod.yaml -s templates/api-deployment.yaml | yq '.spec.template.spec.securityContext, .spec.template.spec.containers[].securityContext'
kubectl get clusterpolicy require-run-as-nonroot -o yaml

Fix → Set the required security context in values or chart defaults. Request a documented policy exception only when justified.

Prevent → Run the same policies in CI against rendered output (Kyverno CLI, Conftest) and use --dry-run=server before deploying.

All Helm questions Roadmap: Helm

More on Install & Upgrade Failures