Interview Prep/Helm/Chart Design & Authoring

A security review requires every pod to run non-root with a read-only filesystem. How do you enforce it in your charts?

IntermediateScenarioChart Design & Authoring
Answer

Situation read → Defaults must be secure, and overriding them should be visible.

What I'd do →

  1. Default values:
podSecurityContext: { runAsNonRoot: true, runAsUser: 10001, fsGroup: 10001, seccompProfile: { type: RuntimeDefault } }
securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } }
  1. Add an emptyDir for /tmp so apps can still write scratch files.
  2. Put these defaults in the library chart so all services inherit them.
  3. Enforce at the cluster with Pod Security Admission restricted or Kyverno, so charts that override them fail loudly.

Why → Chart defaults make the right thing easy; admission policy makes the wrong thing impossible.

Interview tip → Defense in depth: chart defaults plus admission control, not one or the other.

All Helm questions Roadmap: Helm

More on Chart Design & Authoring