fix(chart): expose external scaler securityContext with seccompProfile (#3196) - #3199
Conversation
#3196) The KEDA external scaler Deployment hardcoded its container securityContext and omitted seccompProfile, which violates Pod Security Admission `restricted` and Kyverno `restrict-seccomp-strict` policies. Upgrading to chart 0.57.0 broke installs on policy-enforced clusters with no values-level workaround. Add a configurable `autoscaling.externalScaler.securityContext` value (matching the pattern used by other chart components) whose default keeps the existing hardened settings and adds `seccompProfile: {type: RuntimeDefault}`, making the chart PSA-compliant out of the box while letting users override it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoHelm chart: make external scaler securityContext configurable and PSA compliant
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full |
Fixes #3196
The KEDA external scaler
Deploymentintroduced in chart 0.57.0 hardcodes its containersecurityContextand omitsseccompProfile. On clusters enforcing Pod Security Admissionrestrictedor Kyvernorestrict-seccomp-strict, the deployment is rejected:Because the values were hardcoded, users had no values-level way to fix it — the only workaround was disabling the external scaler entirely (
autoscaling.externalScaler.enabled: false).Changes
values.yaml— Add a configurableautoscaling.externalScaler.securityContextvalue (matching the pattern used by other chart components such ashuband the nodes). Its default preserves the previously hardened settings and addsseccompProfile: {type: RuntimeDefault}, so the chart is PSArestrictedcompliant out of the box.templates/external-scaler.yaml— Render the value via{{- with $scaler.securityContext }}instead of hardcoding, so it is fully overridable (and can be disabled by setting it tonull).CONFIGURATION.md— Regenerated via helm-docs.This addresses both remediation options requested in the issue: the securityContext is now configurable and compliant by default.
Verification
helm lintpasses.seccompProfile.type: RuntimeDefaultalongside the existing hardening.--set autoscaling.externalScaler.securityContext.seccompProfile.type=Localhost) merges correctly.nullcleanly omits the block for users who manage security context at the pod level.🤖 Generated with Claude Code