Chart Design & Authoring
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q1 Your team has 15 near-identical YAML folders, one per microservice per environment. How do you introduce Helm?
Beginner
Situation read โ Copy-paste manifests drift; a fix applied to one service never reaches the others. The variation is small: image, port, replicas, env vars, resources.
What I'd do โ
- Diff the folders to find what actually varies; that list becomes
values.yaml. helm createone chart, strip it to Deployment, Service, ServiceAccount, HPA, PDB, Ingress, with helpers for names and labels.- Convert one low-risk service, compare
helm templateoutput with the existing YAML (diff <(helm template ...) <(cat old/*.yaml)), and deploy to dev. - Roll out service by service; adopt existing objects with Helm ownership metadata (or
--take-ownershipon Helm 3.17+). - Once three services fit, extract common templates into a library chart.
Why โ Starting from real variation avoids an over-engineered "chart of everything".
Interview tip โ Mention that you validated equivalence by diffing rendered output before cutting over.
Q2 Should you build one generic chart for all microservices or one chart per service?
Intermediate
Situation read โ A generic chart gives consistency; per-service charts give flexibility. Both have failure modes: a generic chart grows hundreds of flags, per-service charts diverge.
What I'd do โ
- Use a library chart for shared templates (Deployment, Service, HPA, PDB, labels, security defaults).
- Give each service a thin application chart that depends on the library and adds only what is unique (a CronJob, a sidecar).
- Version the library; services bump it deliberately via
Chart.lock. - Keep a "golden" generic app chart only for truly standard stateless services.
Why โ Shared code with a versioned contract, without forcing every edge case into one template.
Interview tip โ Say "library chart plus thin service charts" and explain the versioning benefit.
Q3 A developer hardcoded namespace: production in every template. What is wrong and how do you fix it?
Beginner
namespace: production in every template. What is wrong and how do you fix it?Situation read โ The chart can no longer be installed into any other namespace; helm install -n staging would still create objects in production, while the release record lands in staging.
What I'd do โ
- Remove
metadata.namespacefrom templates, or set it to{{ .Release.Namespace }}for clarity. - Replace hardcoded namespaces in DNS names with
{{ .Release.Namespace }}(api.{{ .Release.Namespace }}.svc.cluster.local). - Add a CI check:
helm template x ./chart -n ci-test | grep -E '^\s+namespace:' | grep -v ci-testmust be empty.
Why โ The namespace is a deploy-time decision; charts must stay portable.
Interview tip โ Note that release records and objects in different namespaces confuse helm uninstall.
Q4 Changing a ConfigMap value in the chart does not restart the pods, so the app keeps old config. What do you change?
Intermediate
Situation read โ Pods read config at startup (env vars or a file loaded once). A ConfigMap update does not change the pod template, so no rollout happens.
What I'd do โ
- Add a checksum annotation to the pod template:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/api-configmap.yaml") . | sha256sum }}- Do the same for Secrets the chart renders.
- For externally managed config, use a tool like Stakater Reloader, or include a version value in the name of the ConfigMap.
Why โ Any config change now alters the pod template hash and triggers a normal rolling update.
Interview tip โ Avoid .Release.Revision annotations; they restart pods on every deploy even when nothing changed.
Q5 You need the same chart to support both Ingress and Gateway API HTTPRoute. How do you design it?
Intermediate
Situation read โ Some clusters run ingress-nginx, newer ones use Gateway API. The chart must not force either.
What I'd do โ
- Add two independent blocks:
ingress.enabledandhttpRoute.enabled, each with its own template. - Guard the HTTPRoute with
.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1/HTTPRoute"andfailwith a clear message if enabled but missing. - Share host and path values through a helper so both render from the same source.
- Add a schema rule that rejects both enabled at once if that is not supported.
Why โ Feature flags plus capability checks keep one chart portable across cluster generations.
Interview tip โ Mention testing both paths with helm template --api-versions.
Q6 Your chart's Deployment template has grown to 300 lines of nested ifs. How do you clean it up?
Intermediate
ifs. How do you clean it up?Situation read โ Every consumer request became a flag; nobody can review the template.
What I'd do โ
- Move repeated fragments (probes, security context, env, volume mounts) into named helpers in
_helpers.tplor a library. - Replace field-by-field options with
toYamlpassthrough for standard Kubernetes blocks (affinity,tolerations,securityContext). - Add escape hatches (
extraEnv,extraVolumes,extraContainers) instead of new flags. - Add helm-unittest suites that pin current output, then refactor safely.
- Delete unused flags in a major version bump.
Why โ Templates should express opinions; passthroughs handle the long tail.
Interview tip โ Say you put unit tests in place before refactoring templates.
Q7 How do you make a chart work for both a stateless API and a worker that has no Service?
Intermediate
Situation read โ Same code base, two run modes; the worker must not get a Service, Ingress or HTTP probes.
What I'd do โ
- Model components in values:
api.enabled,worker.enabled, each with image args, replicas and resources. - Render the Service and Ingress only for
api, wrapping each template in{{- if .Values.api.enabled }}. - Give the worker exec or no probes, and its own
app.kubernetes.io/component: workerselector label. - Share image settings through a common
imageblock with per-component overrides.
Why โ Components keep selectors distinct, so the API Service never routes to worker pods.
Interview tip โ Highlight the component label in selectors as the thing that keeps them separate.
Q8 A security review requires every pod to run non-root with a read-only filesystem. How do you enforce it in your charts?
Intermediate
Situation read โ Defaults must be secure, and overriding them should be visible.
What I'd do โ
- Default values:
podSecurityContext: { runAsNonRoot: true, runAsUser: 10001, fsGroup: 10001, seccompProfile: { type: RuntimeDefault } }
securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } }- Add an
emptyDirfor/tmpso apps can still write scratch files. - Put these defaults in the library chart so all services inherit them.
- Enforce at the cluster with Pod Security Admission
restrictedor 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.
Q9 Your app needs a different config file per environment, with values injected. How do you package it?
Intermediate
Situation read โ Config files are long; embedding them as YAML strings in values is unreadable.
What I'd do โ
- Keep the template config in
files/app.conf.tplinside the chart with placeholders like{{ .Values.app.logLevel }}. - Render it into a ConfigMap with
tpl:
data:
app.conf: |-
{{ tpl (.Files.Get "files/app.conf.tpl") . | indent 4 }}- Expose only the variable parts as values per environment.
- Add a checksum annotation so changes roll the pods.
Why โ The file stays readable and diffable; environments differ only in values.
Interview tip โ Mention .helmignore and that .Files cannot read files under templates/.
Q10 Two releases of your chart in the same cluster collide on a ClusterRole name. How do you fix the chart?
Intermediate
Situation read โ Cluster-scoped resources are not namespaced, so a static name like shop-reader is shared by every release and the second install fails with "already exists".
What I'd do โ
- Name cluster-scoped objects with release and namespace:
{{ printf "%s-%s" .Release.Namespace (include "shop.fullname" .) | trunc 63 | trimSuffix "-" }}. - Ask whether a namespaced Role is enough; prefer it.
- Make cluster-scoped resources optional (
rbac.clusterWide: false).
Why โ Unique names make the chart installable multiple times, which is a basic chart requirement.
Interview tip โ Call out CRDs as the one cluster-scoped thing that should be shared, and managed separately.
Q11 A teammate wants to put the image tag in Chart.yaml appVersion only. Another wants it only in values. What do you recommend?
Intermediate
Chart.yaml appVersion only. Another wants it only in values. What do you recommend?Situation read โ Both work; the question is what is the source of truth and how rollbacks behave.
What I'd do โ
- Template:
{{ .Values.image.tag | default .Chart.AppVersion }}, so both are possible. - For internal apps released together with their chart, set
appVersionat package time (helm package --app-version $VERSION) so one chart version pins one image. - For GitOps environments where images change often, set the tag in the environment values file and let CI or Image Updater commit it.
- Never use
latest.
Why โ One pinned value per deploy keeps helm history meaningful and rollbacks exact.
Interview tip โ Say the important thing is immutability and traceability, not where the tag lives.
Q12 Your chart must run on OpenShift and vanilla Kubernetes. What needs care?
Advanced
Situation read โ OpenShift's restricted SCC assigns a random UID per namespace and rejects fixed runAsUser; it also uses Routes.
What I'd do โ
- Make
runAsUser/fsGroupoptional (render only when set) and ensure images work with arbitrary UIDs (group 0 writable dirs). - Detect OpenShift with
.Capabilities.APIVersions.Has "route.openshift.io/v1"and optionally render a Route. - Avoid privileged ports (<1024) and hostPath.
- Test with
helm template --api-versions route.openshift.io/v1and on a CRC or OKD cluster in CI.
Why โ Platform differences belong in capability checks and values, not forks.
Interview tip โ Mention arbitrary UID support as the most common OpenShift chart failure.
Q13 You need to deploy the same app to 40 tenant namespaces with small differences. How do you organize it?
Advanced
Situation read โ 40 releases of one chart; differences per tenant (domain, quotas, feature flags).
What I'd do โ
- One chart, one release per tenant namespace (
tenant-a,tenant-b), never a single release looping over tenants (a single failure would block all). - Generate releases with an Argo CD ApplicationSet (list or Git directory generator) or Helmfile with a tenants file.
- Per-tenant values files are tiny: domain, size tier, flags.
- Roll out chart versions progressively: canary tenants first, then the rest, using sync waves or Helmfile labels.
Why โ Independent releases give per-tenant blast radius, history and rollback.
Interview tip โ Explain why "one release per tenant" beats one giant release.
Q14 Product wants a "maintenance mode" toggle that swaps the frontend for a static page. How would you implement it in the chart?
Intermediate
Situation read โ It must be fast to toggle and reversible.
What I'd do โ
- Add
maintenance.enabledand render a small nginx Deployment with a ConfigMap page when true. - Switch the Service selector or Ingress backend to the maintenance component in the same render.
- Toggle through the normal pipeline: the full values files plus
--set maintenance.enabled=true(not--reuse-values), or a one-line commit in GitOps. - Keep the main Deployment running, so switching back is instant.
Why โ Selector switch is atomic at the Service level; no pods need to restart.
Interview tip โ Show you thought about the toggle being a normal, reviewed deploy, not a manual edit.
Q15 You inherit a chart with no labels helper; every template has different labels. How do you fix it without downtime?
Advanced
Situation read โ Adding labels is safe, but changing selectors on Deployments is not (immutable).
What I'd do โ
- Add
shop.labelsandshop.selectorLabelshelpers; applylabelsto all metadata. - Keep the existing selectors exactly as they are for now (copy them into
selectorLabels). - If selectors must change, do it in a major chart version with a documented migration: delete the Deployment with
kubectl delete deploy shop-api --cascade=orphan, upgrade (new Deployment adopts nothing because labels differ, so it creates new pods), then delete orphaned old ReplicaSets after the new pods are Ready. - Use
helm diffto confirm only metadata labels change in step 1.
Why โ Metadata labels are mutable; selectors are not.
Interview tip โ Saying "selectors are immutable, so I orphan-delete" shows real experience.
Q16 Leadership asks why you are adopting Helm instead of Kustomize. How do you answer?
Beginner
Situation read โ It is a trade-off question; neither tool is universally better.
What I'd do โ
- Helm for packaging and distribution: versioned charts, dependencies, release history, rollback, hooks; most third-party software ships as charts.
- Kustomize for small overlays on our own plain manifests; no templating language to learn.
- Propose Helm for apps and platform components, with Kustomize allowed as a post-renderer or Argo CD layer for last-mile patches.
Why โ Using the right tool per layer avoids forcing templates where patches suffice.
Interview tip โ Avoid tool wars; frame it as packaging vs patching.
Q17 The chart must support an optional sidecar (log shipper) that some environments need. How do you add it cleanly?
Intermediate
Situation read โ Optional container, with its own image, resources and config.
What I'd do โ
- Add
logShipper.enabled,logShipper.image,logShipper.resourcesin values. - In the pod spec, render the container inside
{{- if .Values.logShipper.enabled }}, plus its ConfigMap and sharedemptyDirvolume. - Alternatively offer generic
extraContainers(rendered withtpl (toYaml .Values.extraContainers) .) for any sidecar. - Consider native sidecars (init container with
restartPolicy: Always, Kubernetes 1.29+) so it starts before and stops after the app.
Why โ A dedicated block for common sidecars, plus a generic escape hatch for rare ones.
Interview tip โ Mentioning native sidecars shows you track current Kubernetes features.
Q18 How would you test chart templates in CI without a cluster?
Intermediate
Situation read โ You want fast feedback on template changes on every PR.
What I'd do โ
helm lint --strictagainst each environment's values files.helm templatefor each environment piped intokubeconform -strictfor schema validity.- helm-unittest suites asserting specific output (selector labels, replicas absent when HPA enabled, image tag).
- Policy checks with Conftest/Kyverno CLI (non-root, limits set).
- Golden-file diffs: commit rendered output and fail if it changes unexpectedly.
Why โ These layers catch syntax, schema, logic and policy errors in seconds.
Interview tip โ Name helm-unittest and kubeconform explicitly.
Values & Environments
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q19 Dev, staging and prod values files have drifted and nobody knows which settings differ intentionally. What do you do?
Intermediate
Situation read โ Each file copied the full values.yaml and edited it over time, so real differences are buried.
What I'd do โ
- Render each environment and diff:
diff <(helm template s ./shop -f values-staging.yaml) <(helm template s ./shop -f values-prod.yaml). - Rewrite each env file to contain only overrides of chart defaults; move shared settings into
values-common.yaml. - Annotate intentional differences with comments ("prod: 3 replicas for HA").
- Add a CI job that prints the staging-vs-prod rendered diff on every PR.
Why โ Small override files make differences reviewable and staging a real rehearsal for prod.
Interview tip โ Say env files should contain overrides only, never a copy of defaults.
Q20 A deploy pipeline uses --reuse-values and a new chart version just broke production. Why, and what do you change?
Advanced
--reuse-values and a new chart version just broke production. Why, and what do you change?Situation read โ The new chart added api.probes.startup in values.yaml, and the template reads it. With --reuse-values, Helm used the old release's values as the base, so the new default never arrived and the template rendered an empty probe.
What I'd do โ
- Roll back:
helm rollback shop -n shop. - Change the pipeline to pass every values file explicitly and drop
--reuse-values(or use--reset-then-reuse-valuesif you must keep ad-hoc overrides). - Make templates defensive (
with,default) for newly added keys. - Keep env values in Git so the full set is always available.
Why โ A deploy should be fully reproducible from Git, not dependent on what the previous run stored.
Interview tip โ Explaining the mechanics of --reuse-values is a strong signal.
Q21 You need a per-environment image tag set by CI, while everything else lives in Git. How do you wire it?
Beginner
Situation read โ The tag changes on every build; the rest is reviewed config.
What I'd do โ
- Imperative CI:
helm upgrade --install shop ./shop -f values-prod.yaml --set-string api.image.tag=$GIT_SHA. - GitOps: CI opens a PR or commits
api.image.tag: <sha>toenvs/prod/values.yaml; Argo CD syncs. - Use
--set-stringso tags like1.10or0123abckeep their exact text. - Record the SHA in
--descriptionfor traceability.
Why โ Either way the deployed tag is traceable; GitOps also makes rollback a revert.
Interview tip โ Mention --set-string and why.
Q22 A value that should be false in prod keeps rendering as enabled. Where do you look?
Intermediate
false in prod keeps rendering as enabled. Where do you look?Situation read โ Classic causes: default true .Values.x, --set-string x=false (the string "false" is truthy), or a later values file setting it back.
What I'd do โ
helm get values shop -n shop --all | yq '.feature'to see the final merged value and its type.- Grep the templates for
default trueon that key. - Check the order of
-ffiles and any--setin the pipeline. - Fix the template to use
hasKeyor put the default invalues.yaml; use--set(not--set-string) for booleans.
Why โ Helm's emptiness rules treat false as unset in default.
Interview tip โ Quote the default boolean trap; interviewers love it.
Q23 Different clusters need different storage classes and ingress classes. How do you keep the chart portable?
Intermediate
Situation read โ EKS uses gp3, the on-prem cluster uses longhorn; ingress classes differ too.
What I'd do โ
- Expose
persistence.storageClassandingress.classNamein values; renderstorageClassNameonly when set so the cluster default applies otherwise. - Support
global.storageClassso subcharts share it. - Put cluster-specific values in a per-cluster file (
clusters/eks-prod.yaml) layered under env files.
Why โ Cluster facts are deploy-time inputs, not chart constants.
Interview tip โ Note that an empty storageClassName: "" disables dynamic provisioning, which is why you omit it rather than render empty.
Q24 A developer passes 20 --set flags in a shell script. What would you change?
Beginner
--set flags in a shell script. What would you change?Situation read โ Long --set chains are unreadable, hard to review, error prone with commas and dots, and invisible in Git history.
What I'd do โ
- Move them into a values file committed next to the deploy definition.
- Keep
--set-stringonly for truly dynamic values (image tag, build number). - Use
--set-filefor file content and secrets viasecrets://files.
Why โ Values files are diffable and reviewable; flags are not.
Interview tip โ Reproducibility from Git is the argument that wins.
Q25 You must deploy to a region with an air-gapped cluster. How do you handle values and images?
Advanced
Situation read โ No internet: chart dependencies, images and OCI pulls must come from inside.
What I'd do โ
- Mirror charts (
helm pullthenhelm pushto the internal registry) including subcharts, and vendor them intocharts/at package time. - Mirror every image referenced by the rendered manifests:
helm template ... | yq '..|.image? | select(.)' | sort -u. - Override registries via
global.imageRegistryor per-image values. - Package a single
.tgzwith dependencies included so install needs no repo access. - Verify with
helm templatethat no image still points to a public registry.
Why โ Air-gapped deploys fail on the first external reference; rendering is how you find them all.
Interview tip โ Mention extracting images from rendered output rather than trusting the README.
Q26 A feature flag must be enabled for 10% of tenants first. How does your Helm setup support it?
Intermediate
Situation read โ Helm configures deployments, not request-level flags; but per-release values can stage rollouts.
What I'd do โ
- Keep the flag in values (
features.newCheckout: false) and set it true in a "canary" tenant group's values file. - In Helmfile or ApplicationSet, label tenants by wave and roll the change wave by wave.
- For per-request percentages, use a feature flag service (OpenFeature, LaunchDarkly, Unleash) and keep only its endpoint/key in values.
Why โ Release-level flags give blast-radius control; request-level ones need a flag service.
Interview tip โ Distinguish config rollout from request-level feature flagging.
Q27 A values file accidentally set resources: {} in prod and pods have no limits. How do you prevent this class of mistake?
Intermediate
resources: {} in prod and pods have no limits. How do you prevent this class of mistake?Situation read โ An override erased the safe defaults; nothing complained.
What I'd do โ
- Add schema constraints:
resources.limits.memoryrequired for the API invalues.schema.json. - Enforce at admission (Kyverno
require-limitspolicy) so manifests without limits are rejected. - Add a CI policy check on rendered output (Conftest) per environment.
- Use LimitRange defaults in namespaces as a last line.
Why โ Schema stops bad values early; admission policy stops bad manifests regardless of source.
Interview tip โ Say "schema plus admission policy" for guardrails.
Q28 You want developers to preview exactly what their values change will do to prod. What do you provide?
Beginner
Situation read โ People change values blind and find out during deploy.
What I'd do โ
- A PR job running
helm diff upgrade shop <chart> -n shop -f values-prod.yaml --context 3 --suppress-secretswith read-only cluster credentials, posting output as a PR comment. - For GitOps, use Argo CD's diff (
argocd app diff) or a rendered-manifests diff in the PR. - Require approval on prod diffs.
Why โ A visible diff turns a values tweak into a reviewable infrastructure change.
Interview tip โ Compare helm diff to terraform plan.
Q29 Some values are secret, some are not, and both are needed per environment. How do you lay out the files?
Intermediate
Situation read โ Mixing them forces either encrypting everything (unreadable reviews) or leaking secrets.
What I'd do โ
values-prod.yamlfor plain config,secrets.prod.yamlencrypted with SOPS (only secret keys).- Use the same key structure so they deep-merge:
postgres.auth.passwordlives in the secrets file only. - Deploy with
-f values-prod.yaml -f secrets://secrets.prod.yaml. .sops.yamlcreation rules choose the KMS key per environment.
Why โ Plain config stays reviewable; secrets stay encrypted at rest in Git.
Interview tip โ Mention that SOPS encrypts values, not keys, so diffs still show which secret changed.
Q30 A third-party chart has 2,000 lines of values. How do you manage your overrides?
Beginner
Situation read โ Copying the full defaults file makes upgrades painful.
What I'd do โ
helm show values repo/chart --version X > upstream-X.yamlfor reference only (not deployed).- Keep our override file minimal: only keys we change, with comments.
- On chart upgrades, diff
upstream-X.yamlvsupstream-Y.yamlto spot renamed keys, then runhelm diff. - Pin the chart version.
Why โ A minimal override file keeps upgrades understandable.
Interview tip โ Say you diff upstream defaults between versions before upgrading.
Q31 You need to inject a JSON config blob as a single value. What is the cleanest way?
Intermediate
Situation read โ JSON inside YAML strings is error prone with quoting.
What I'd do โ
- Model it as structured YAML in values and render it with
toJson(ortoPrettyJson) into the ConfigMap:
data:
config.json: {{ .Values.app.config | toJson | quote }}- For one-off structured overrides on the CLI, use
--set-json 'app.config={"retries":3}'. - Validate the structure in
values.schema.json.
Why โ Structured values merge across files; opaque strings do not.
Interview tip โ Mention that structured values allow per-environment partial overrides.
Q32 Prod uses RDS while dev uses an in-cluster Postgres subchart. How do you configure the chart?
Intermediate
Situation read โ Same app, different database source.
What I'd do โ
- Dependency with
condition: postgres.enabled; dev setstrue, prodfalse. - Add
externalDatabase.host,port,existingSecretvalues for prod. - A helper
shop.dbHostreturns the subchart Service name or the external host, and fails if neither is configured. - Prod credentials come from an ExternalSecret referencing Secrets Manager.
Why โ One chart, explicit switch, with a helper hiding the difference from templates.
Interview tip โ Show the fail guard for the "nothing configured" case.
Q33 A values key rename is needed (image.name to image.repository). How do you avoid breaking users?
Advanced
image.name to image.repository). How do you avoid breaking users?Situation read โ Consumers have overrides with the old key; a silent rename would deploy the default image.
What I'd do โ
- Support both for one minor version:
{{ .Values.image.repository | default .Values.image.name }}. - Emit a deprecation warning in
NOTES.txtwhen the old key is set. - Remove it in the next major version, and in that version
failif the old key is still present, with instructions. - Document it in the chart changelog (
artifacthub.io/changesannotation).
Why โ A deprecation window plus a hard failure is far safer than a silent behavior change.
Interview tip โ "Fail loudly on removed keys" is the key phrase.
Q34 Your team edits live resources with kubectl edit during incidents and then Helm reverts them. How do you handle this?
Advanced
kubectl edit during incidents and then Helm reverts them. How do you handle this?Situation read โ Live fixes are lost at the next deploy, or worse, kept silently in some fields because of the three-way merge.
What I'd do โ
- Allow emergency edits but require a follow-up PR to the values within the incident.
- Run
helm diff upgrade --three-way-mergebefore deploys so drift is visible. - With Argo CD, enable self-heal so manual changes are reverted immediately and the only path is Git.
- Lock down
editon prod for humans via RBAC; use break-glass roles.
Why โ Git as source of truth only works if drift is visible and short-lived.
Interview tip โ Tie this to the three-way merge and why drift may or may not survive.
Dependencies, Subcharts & Library Charts
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q35 You depend on a public Postgres chart, and its default images stopped being freely available. What do you do?
Intermediate
Situation read โ Vendors do change distribution (in 2025 one major chart vendor moved most free images to a legacy repository), and pods suddenly fail with ImagePullBackOff on new nodes.
What I'd do โ
- Pin image registry, repository and tag explicitly in our values instead of relying on chart defaults.
- Mirror the images we use into our own registry (ECR/Harbor) and point the chart there.
- Evaluate alternatives: an operator (CloudNativePG), a managed database for prod, or our own small subchart for dev.
- Pin the chart version and track the vendor's announcements.
Why โ Chart defaults are someone else's decision; production must not depend on them.
Interview tip โ Saying "we mirror every image and pin digests" covers this whole class of incident.
Q36 Your umbrella chart takes 25 minutes to upgrade and a failure in one component rolls back everything. How do you restructure?
Advanced
Situation read โ One release containing ten subcharts: shared fate, huge release Secret, and any slow rollout blocks all.
What I'd do โ
- Split into one release per component, managed by Helmfile (
needs:for ordering) or Argo CD Applications with sync waves. - Keep the umbrella only for tightly coupled pieces that must deploy together.
- Migrate without downtime by adopting existing objects into the new releases (ownership annotations, or
--take-ownershipon Helm 3.17+), then remove the old release withhelm uninstall --keep-historyonly after the objects are re-owned. - Per-component pipelines and alerts.
Why โ Independent releases give independent rollbacks and faster, smaller upgrades.
Interview tip โ Mention the release Secret size limit (1 MiB) as a hidden cost of umbrellas.
Q37 Ten service charts copy the same _helpers.tpl. A security fix to labels is needed everywhere. What do you build?
Intermediate
_helpers.tpl. A security fix to labels is needed everywhere. What do you build?Situation read โ Copy-paste helpers mean ten PRs per fix.
What I'd do โ
- Create a library chart
shacklib(type: library) withshacklib.labels,shacklib.deployment,shacklib.serviceand security defaults. - Publish it to the OCI registry with SemVer.
- Each service chart adds it as a dependency and replaces its templates with
{{ include "shacklib.deployment" . }}. - Renovate or Dependabot opens PRs to bump the library version across services.
Why โ One versioned source for shared logic, rolled out like any dependency.
Interview tip โ Mention automated dependency bumps to close the loop.
Q38 Two subcharts both define a template named common.labels and resources get the wrong labels. How do you fix it?
Advanced
common.labels and resources get the wrong labels. How do you fix it?Situation read โ Template names are global; the last loaded definition wins silently.
What I'd do โ
- Find duplicates:
grep -rho 'define "[^"]*"' charts/ templates/ | sort | uniq -d(afterhelm pull --untarof dependencies). - Rename our own templates with a unique prefix.
- For third-party conflicts, align both on the same shared library version (they usually come from a common library chart) or vendor and patch one.
- Add a CI check for duplicate define names.
Why โ Unique prefixes are the only protection Helm offers.
Interview tip โ Explain why prefixing helper names is not just style.
Q39 How would you let a parent chart override a subchart's image registry for all subcharts at once?
Intermediate
Situation read โ Corporate policy requires all images from the internal registry.
What I'd do โ
- Set
global.imageRegistry: registry.internalin the parent values. - In our own subcharts, build images with
coalesce .Values.image.registry .Values.global.imageRegistry. - For third-party subcharts, check which global keys they support; otherwise override each image explicitly.
- Verify with
helm template ... | grep 'image:'.
Why โ global is the only value Helm propagates to every subchart automatically.
Interview tip โ Verify through rendered output, not assumptions.
Q40 A subchart upgrade (minor version) changed a default and broke your app. How do you prevent surprises?
Intermediate
Situation read โ Range constraints like ^12.0.0 pulled a new minor with different defaults.
What I'd do โ
- Commit
Chart.lockand build withhelm dependency build, so versions change only via deliberatehelm dependency updatePRs. - In those PRs, show
helm diff/ rendered-manifest diffs for each environment. - Pin the values that matter to us explicitly rather than relying on subchart defaults.
Why โ Lockfiles plus rendered diffs turn dependency bumps into reviewed changes.
Interview tip โ Same reasoning as package lockfiles in application code.
Q41 You need two Redis instances (cache and queue) from the same chart in one release. How?
Intermediate
Situation read โ Same chart, two instances, different configs.
What I'd do โ
- Declare the dependency twice with
alias: cacheandalias: queue. - Configure each under its alias key in values.
- Reference Services by the alias-based names (
<release>-cache-master, depending on the chart's naming). - Give each its own
conditionso either can be disabled.
Why โ Aliases create separate value scopes and resource names from one chart.
Interview tip โ Mention that .Chart.Name becomes the alias inside the subchart.
Q42 A subchart needs a password that the parent generates. How do you share it?
Advanced
Situation read โ Subcharts cannot see parent values, and generating it twice gives two different values.
What I'd do โ
- Prefer an "existing secret" pattern: the parent (or an ExternalSecret) creates a Secret with a known name, and the subchart is configured with
auth.existingSecret: shop-db. - Or pass the same value explicitly to both: parent
db.passwordandpostgres.auth.passwordfrom one secrets file. - Avoid
randAlphaNumin both places.
Why โ One Secret object, referenced by name, avoids duplication and drift.
Interview tip โ "existingSecret" is the pattern most good charts support; mention it.
Q43 A team wants their chart to work standalone and as a subchart of a platform umbrella. What do you watch for?
Advanced
Situation read โ As a subchart, names, globals and value scopes change.
What I'd do โ
- Never read parent-only values; use
globalfor shared settings and document which ones. - Use the
fullnamehelper (release + chart name) so names stay unique under the umbrella. - Avoid relying on
.Release.Namealone for resource names. - Test both:
helm templatestandalone, and as a dependency in a test umbrella chart in CI.
Why โ Subcharts share the release but must remain self-contained.
Interview tip โ Testing both modes in CI is the concrete answer.
Q44 You have to disable a subchart's bundled helm test that fails in your environment. What are your options?
Beginner
helm test that fails in your environment. What are your options?Situation read โ The parent's helm test runs subchart tests too.
What I'd do โ
- Check the subchart's values for a test toggle (many have
tests.enabled). - Otherwise filter:
helm test shop --filter '!name=shop-redis-test-connection'. - As a last resort, a post-renderer that drops the test Pod.
Why โ Filtering keeps your own tests while skipping noisy third-party ones.
Interview tip โ Know the --filter syntax.
Q45 How would you handle a dependency that is only available in a private HTTP chart repo in CI?
Beginner
Situation read โ helm dependency build fails without repo configuration and credentials.
What I'd do โ
- In CI:
helm repo add internal https://charts.internal --username "$U" --password "$P"before building. - Isolate Helm config per job (
HELM_CONFIG_HOME,HELM_CACHE_HOMEin the workspace). - Better: move internal charts to OCI and use
helm registry loginwith short-lived tokens (OIDC to ECR/GHCR).
Why โ OCI removes the repo-add step and reuses registry auth you already have for images.
Interview tip โ Mention short-lived credentials over static passwords.
Q46 A library chart change accidentally altered selectors in all services. How do you limit blast radius next time?
Advanced
Situation read โ Libraries amplify mistakes; every bump touches every service.
What I'd do โ
- helm-unittest suites in the library that assert selector labels never change.
- A consumer test matrix: render each service chart with the new library version and diff against the previous output in CI.
- Treat selector or name changes as major versions; Renovate auto-merges only patch bumps.
- Roll out library bumps to a canary service first.
Why โ Library changes need contract tests, like any shared API.
Interview tip โ Frame the library as an API with consumers.
Releases, Upgrades & Rollbacks
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q47 A production upgrade starts failing health checks five minutes after the deploy. What do you do?
Beginner
Situation read โ The new revision is live and degrading; restore service first, investigate second.
What I'd do โ
helm history shop -n shopto find the last good revision.helm rollback shop <rev> -n shop --wait --timeout 5m.- Confirm:
kubectl rollout status deploy/shop-api -n shop, error rates back to normal. - Then compare:
helm diff revision shop <good> <bad>and look at logs from the failed pods. - Fix forward in a new chart or image version.
Why โ Rollback is the fastest mitigation, as long as the change was backward compatible.
Interview tip โ Say "mitigate, then diagnose", and mention checking DB compatibility before rolling back.
Q48 Why would you insist on --atomic --wait in CI, and what is the trade-off?
Intermediate
--atomic --wait in CI, and what is the trade-off?Situation read โ Without them, Helm reports success as soon as the API accepts objects, and failed upgrades leave a failed release.
What I'd do โ
- Use
helm upgrade --install --atomic --wait --timeout 10m. - Size
--timeoutfor the slowest rollout plus hooks. - Make readiness probes meaningful so "ready" means "works".
Why โ CI gets a true success/failure signal and failures self-heal. The trade-off: an automatic rollback erases the broken state you might want to inspect, and a too-short timeout causes needless rollbacks. Capture kubectl describe and logs in the failure step before Helm rolls back, or use --wait alone with an explicit rollback step.
Interview tip โ Mention capturing diagnostics because --atomic destroys evidence.
Q49 You need zero-downtime upgrades of the API with Helm. What must be true in the chart?
Intermediate
Situation read โ Helm only patches the Deployment; zero downtime depends on the pod spec and rollout settings.
What I'd do โ
strategy.rollingUpdate: { maxUnavailable: 0, maxSurge: 25% }.- Readiness probes that reflect real readiness;
preStopsleep of a few seconds and gracefulSIGTERMhandling withterminationGracePeriodSeconds. - PDB with
minAvailableormaxUnavailable: 1; at least two replicas. - Backward-compatible DB changes.
- Do not set
replicaswhen HPA is enabled.
Why โ Rolling updates are only safe when Kubernetes knows when pods can and cannot take traffic.
Interview tip โ Mention the preStop delay to cover endpoint propagation.
Q50 A pipeline was cancelled mid-upgrade and now every deploy fails with "another operation is in progress". What do you do?
Advanced
Situation read โ The Helm process died while the release was in pending-upgrade; the lock never cleared.
What I'd do โ
- Confirm no other pipeline is running for this environment.
helm history shop -n shopand find thepending-upgraderevision and the lastdeployedone.helm rollback shop <last-deployed-rev> -n shop --wait.- If rollback refuses, delete only the pending revision Secret:
kubectl delete secret sh.helm.release.v1.shop.v<pending> -n shop, then redeploy. - Prevent: CI
concurrencygroups, don't cancel deploy jobs mid-way, and keep--timeoutbelow the CI job timeout.
Why โ Helm's status field acts as a lock; clearing it safely means returning to a known revision.
Interview tip โ Mention the CI timeout vs Helm timeout ordering as root cause prevention.
Q51 A rollback is requested, but the failed release ran a migration that dropped a column. What do you do?
Advanced
Situation read โ Rolling back the pods brings back code that reads a column that no longer exists; Helm will happily do it and break things further.
What I'd do โ
- Do not roll back blindly; check migration content and the previous code's DB expectations.
- If data is lost, restore the column from backup or PITR into a new column and backfill, or fix forward with a hotfix image.
- Communicate the impact and decide between restore and fix forward with the data owner.
- Prevent: expand/contract migrations, never destructive changes in the same release as code changes, mandatory backups in a
pre-upgradehook for risky migrations.
Why โ Helm rollback covers Kubernetes objects only.
Interview tip โ State clearly that Helm cannot roll back a database.
Q52 The team scaled a Deployment manually to 10 replicas during a traffic spike. The next deploy scaled it back to 3. Explain and fix.
Intermediate
Situation read โ The three-way merge sees live 10, chart 3, and patches back to 3.
What I'd do โ
- Enable an HPA and omit
replicasfrom the template when autoscaling is on. - If manual scaling is a policy, put the new count in values and deploy it.
- With Argo CD, add
ignoreDifferenceson/spec/replicaswhen HPA manages it.
Why โ Only one controller should own a field.
Interview tip โ Use the phrase "field ownership" and mention server-side apply.
Q53 How do you safely upgrade a third-party chart across a major version (for example ingress-nginx)?
Advanced
Situation read โ Major versions may rename values, change selectors or bump CRDs.
What I'd do โ
- Read the changelog and upgrade notes between versions.
helm show valuesfor old and new; diff to find renamed keys; update our override file.helm diff upgradeagainst staging; watch for Deployment selector changes (immutable) or Service type changes.- Apply CRDs separately if the chart ships new ones in
crds/. - Upgrade staging, run smoke tests, then prod in a window with a rollback plan.
Why โ Most major-upgrade outages come from silent value renames or immutable fields.
Interview tip โ Mention CRDs not being upgraded by Helm.
Q54 Upgrades take a long time because --wait waits on a StatefulSet with OrderedReady and 5 replicas. Options?
Advanced
--wait waits on a StatefulSet with OrderedReady and 5 replicas. Options?Situation read โ Rolling a StatefulSet one pod at a time, each waiting for readiness, can exceed the timeout.
What I'd do โ
- Increase
--timeoutrealistically (pods x startup time plus margin). - Use
podManagementPolicy: Parallelif the app does not need ordered startup (affects scale operations, not rolling updates). - Use
updateStrategy.rollingUpdate.maxUnavailable(beta in recent Kubernetes versions) where supported to roll several pods at once. - Separate the stateful component into its own release so app deploys do not wait on it.
Why โ Waiting is correct; the fix is structure and realistic timeouts.
Interview tip โ Splitting stateful components into their own release is the strong answer.
Q55 You discover a release in failed status from last week, but the app is working. Do you care?
Intermediate
failed status from last week, but the app is working. Do you care?Situation read โ A failed upgrade without --atomic may have partially applied; the next upgrade compares against the last successful revision's manifest, which can produce surprising diffs.
What I'd do โ
helm historyandhelm get manifest --revision <failed>to see what was intended.helm diff upgradewith current values to see what the next deploy will do.- Run a clean upgrade (or rollback) to get back to a
deployedstate. - Add alerting on releases in
failedorpending-*status.
Why โ Hidden failed states make the next deploy unpredictable.
Interview tip โ Mention monitoring release status (for example a script over helm list -A --failed --pending).
Q56 How do you implement a canary release when your deploy tool is Helm?
Advanced
Situation read โ Helm itself does all-at-once rolling updates; canaries need traffic splitting.
What I'd do โ
- Use Argo Rollouts: the chart renders a
Rolloutinstead of aDeploymentwith canary steps and analysis. - Or run two releases (
shop-stable,shop-canary) behind a weighted Ingress/Gateway route, with weights in values. - Promote by upgrading stable to the canary version and removing the canary.
- Automate analysis with Prometheus metrics.
Why โ Helm packages and versions the pieces; a progressive delivery controller controls traffic.
Interview tip โ Say Helm is not a progressive delivery tool and name Argo Rollouts or Flagger.
Q57 Releases have 300 revisions each and helm list is slow. What happened and what do you do?
Intermediate
helm list is slow. What happened and what do you do?Situation read โ Someone set --history-max 0 (unlimited) on a frequently deployed release.
What I'd do โ
- Set
--history-max 15in the pipeline; the next upgrade prunes old revisions. - If needed immediately, delete old revision Secrets except the last N:
kubectl get secret -n shop -l owner=helm,name=shop --sort-by=.metadata.creationTimestamp -o name | head -n -15 | xargs kubectl delete -n shop. - Check etcd size trends.
Why โ Each revision is a Secret up to 1 MiB; hundreds of them burden etcd and the API server.
Interview tip โ Know the default is 10 on upgrade.
Q58 Someone uninstalled the production release by mistake. How do you recover, and how do you prevent it?
Advanced
Situation read โ Workloads are gone; PVCs may also be gone unless kept.
What I'd do โ
- If
--keep-historywas used:helm rollback shop <rev>. - Otherwise reinstall from the same chart version and values in Git:
helm upgrade --install .... - Check PVCs: if retained (
resource-policy: keeporRetainreclaim policy), new pods rebind; otherwise restore from backups (Velero, snapshots). - Prevent: RBAC so humans cannot delete in prod,
helm.sh/resource-policy: keepon PVCs and critical Secrets, GitOps with prune protections, and Velero schedules.
Why โ Reproducible deploys from Git make reinstall trivial; data needs its own protection.
Interview tip โ Separate "recreate workloads" (easy) from "recover data" (needs backups).
Q59 You need to move a release to a different namespace. How?
Intermediate
Situation read โ Helm cannot move a release; release records are namespaced.
What I'd do โ
- Install a new release in the target namespace with the same chart and values (new names may clash with cluster-scoped resources; check).
- Migrate data (DB dump/restore or volume snapshot) and switch traffic (DNS/Ingress).
- Uninstall the old release after validation.
Why โ Namespaced objects cannot be moved; it is a blue/green migration.
Interview tip โ Mention cluster-scoped name collisions during the overlap.
Q60 During an upgrade, Helm reports success but a new CronJob was never created. What do you check?
Intermediate
Situation read โ Helm did what the rendered output said; the template probably did not render it.
What I'd do โ
helm get manifest shop -n shop | grep -A3 'kind: CronJob'.helm get values shop --allto check the enabling flag.helm templatelocally with the same values and-s templates/cronjob.yaml.- Look for a condition typo (
.Values.cronjobs.enabledvs.Values.cronJobs.enabled). - Add
additionalProperties: falseon that block in the schema to catch typos.
Why โ If it is not in the manifest, Kubernetes never saw it.
Interview tip โ Start from helm get manifest; it is ground truth.
Q61 Your release takes ownership of a Namespace object. Someone uninstalls the release. What happens?
Advanced
Situation read โ If the chart templated the Namespace, uninstall deletes it, and with it everything inside, including other releases' resources and PVCs.
What I'd do โ
- Never template the release's own namespace; use
--create-namespace(not tracked by the release) or create namespaces via a platform pipeline. - If a chart must create namespaces, annotate them
helm.sh/resource-policy: keep. - Audit existing charts:
helm get manifest <rel> | grep -B2 -A2 'kind: Namespace'.
Why โ Namespace deletion cascades to everything inside.
Interview tip โ Note that --create-namespace namespaces are not deleted by helm uninstall.
Q62 How do you deploy the same release to three clusters consistently?
Intermediate
Situation read โ Multi-cluster: same chart version, cluster-specific values.
What I'd do โ
- GitOps: an Argo CD ApplicationSet with a cluster generator renders one Application per cluster, values from
clusters/<name>/values.yaml. - Or Helmfile with environments per cluster and
--kube-context. - Roll out in waves (staging cluster, one prod cluster, then the rest).
- Charts come from one OCI registry with replication to each region.
Why โ Declarative multi-cluster definitions prevent snowflake clusters.
Interview tip โ ApplicationSet cluster generator is the expected keyword.
Q63 A deploy must not happen if the rendered diff touches a StatefulSet's volumeClaimTemplates. How do you enforce it?
Advanced
Situation read โ volumeClaimTemplates are immutable; such a change fails the upgrade, or tempts someone to use --force.
What I'd do โ
- In CI, render old and new (
helm get manifestvshelm template) and compare the StatefulSet'svolumeClaimTemplateswithyq; fail the job on change. - Or use helm-diff output filtered to the StatefulSet.
- Document the manual procedure for real storage changes (orphan-delete the StatefulSet, resize PVCs, recreate).
Why โ Catching immutable-field changes before deploy avoids failed upgrades in prod.
Interview tip โ Mention kubectl delete sts --cascade=orphan as the safe procedure.
Q64 Your org wants an audit trail of who deployed what with Helm. What do you set up?
Intermediate
Situation read โ Helm history shows revisions, not people.
What I'd do โ
- Deploy only from CI with
--description "sha=$GIT_SHA actor=$ACTOR run=$RUN_URL". - Keep Kubernetes API audit logs (who modified Secrets/Deployments).
- With GitOps, Git history plus Argo CD sync history is the audit trail.
- Restrict human prod access to read-only.
Why โ Combining Git, CI and API audit logs gives who, what and when.
Interview tip โ --description is a nice small detail to mention.
Hooks, Migrations & Testing
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q65 Design database migrations for a Helm-deployed app where the database is a subchart.
Intermediate
Situation read โ Migrations must run once per deploy, before new code needs the new schema, and the DB must exist first.
What I'd do โ
- A Job hook annotated
post-install,pre-upgrade: on install the DB is created first; on upgrade it runs before new pods roll out. - Put the SQL in a hook ConfigMap with weight
-5; the Job has weight0(onpre-upgrade, regular ConfigMaps are not yet updated). - An init container waits for the DB with
pg_isready. hook-delete-policy: before-hook-creation,hook-succeeded;backoffLimit: 1;activeDeadlineSeconds.- Idempotent, backward-compatible migrations (or a migration tool with a lock table: Flyway, Liquibase, golang-migrate).
Why โ Correct hook timing plus idempotency gives repeatable, ordered schema changes.
Interview tip โ Explain why pre-install fails with an in-release database.
Q66 The migration Job takes 12 minutes on prod data and the upgrade times out. What do you change?
Intermediate
Situation read โ --timeout (default 5m) covers hooks; the hook is killed from Helm's view and the upgrade fails.
What I'd do โ
- Short term: raise
--timeout 20mfor this deploy. - Split long data backfills out of the deploy path: run them as a separate Job or background process after the schema change.
- Keep deploy-time migrations to fast DDL; use online schema change tools for big tables.
Why โ Deploys should be fast and predictable; long data work belongs elsewhere.
Interview tip โ Distinguish schema migrations (deploy path) from data backfills (async).
Q67 A migration hook failed and the Job pod was deleted, so you cannot see why. How do you fix the chart?
Beginner
Situation read โ hook-delete-policy included hook-failed, or the Job had ttlSecondsAfterFinished too low.
What I'd do โ
- Use
before-hook-creation,hook-succeeded(nohook-failed) so failed Jobs remain. - Ship hook logs to the central logging stack so they survive deletion.
- In CI, on failure, run
kubectl logs job/shop-migrate -n shop --all-containersbefore anything else.
Why โ Failed hooks are the ones you need to inspect.
Interview tip โ Know the three delete policies and which to omit.
Q68 You want a backup before every production upgrade. How do you do it with Helm?
Intermediate
Situation read โ The backup must finish before the migration runs.
What I'd do โ
pre-upgradeJob with weight-10runningpg_dumpto S3 (or triggering a Velero/RDS snapshot), using IRSA or Pod Identity for credentials.- Migration Job at weight
0. - Enable it only in prod via
backup.enabled. - Alert if the backup Job fails; it fails the upgrade by design.
Why โ Hook weights give strict ordering: backup, then migrate, then roll out.
Interview tip โ Mention verifying restores periodically; a backup never restored is a hope.
Q69 A post-install hook seeds demo data; it ran again on every upgrade and duplicated rows. Why?
Intermediate
post-install hook seeds demo data; it ran again on every upgrade and duplicated rows. Why?Situation read โ The hook annotation probably lists post-install,post-upgrade, or the seed is not idempotent.
What I'd do โ
- Restrict to
post-installif seeding is a one-time action. - Make the seed idempotent (
INSERT ... ON CONFLICT DO NOTHING). - Note: under Argo CD,
post-installmaps toPostSync, which runs on every sync, so idempotency is mandatory there.
Why โ Hooks can run more often than you expect; design them to be safe on repeat.
Interview tip โ Mention the Argo CD mapping.
Q70 How do you clean up external resources (DNS records, S3 buckets) when a release is uninstalled?
Advanced
Situation read โ Helm deletes Kubernetes objects only.
What I'd do โ
- Prefer controllers that own lifecycle: external-dns removes records when the Ingress disappears; Crossplane/ACK delete cloud resources when their CRs are deleted.
- If unavoidable, a
pre-deleteJob that runs a cleanup script with scoped IAM. - Add
helm.sh/hook-delete-policy: hook-succeededand a timeout; document that a failed hook blocks uninstall (--no-hooksskips it).
Why โ Controllers reconcile; one-shot hooks can fail and leak resources.
Interview tip โ Prefer reconciliation over imperative hooks.
Q71 What would you put in helm test for a 3-tier app?
Intermediate
helm test for a 3-tier app?Situation read โ Tests should prove the deployed wiring works.
What I'd do โ
- Test Pod 1:
curl -fsS http://<release>-api:3000/readyz(API up, DB reachable). - Test Pod 2:
curl -fsS http://<release>-frontend:8080/api/items(frontend proxies to API). - Test Pod 3 (optional):
psql -c 'select 1 from items limit 1'(migration applied). - Run
helm test shop --logsin CI right after upgrade.
Why โ Each test validates one hop of the request path.
Interview tip โ Map tests to hops in the architecture.
Q72 Your hook Job never completes because Istio's sidecar keeps the pod running. How do you fix it?
Advanced
Situation read โ The main container exits, but the injected istio-proxy keeps running, so the Job never reaches Complete and Helm waits until timeout.
What I'd do โ
- With native sidecars (Kubernetes 1.29+, Istio configured to use them), the proxy stops automatically when the main container ends.
- Otherwise disable injection for the hook:
sidecar.istio.io/inject: "false"on the pod template if it does not need the mesh. - Or call
curl -X POST localhost:15020/quitquitquitat the end of the script.
Why โ Jobs complete only when all containers exit.
Interview tip โ Mention native sidecars as the modern fix.
Q73 Two hooks with the same weight run in an unexpected order. How does Helm decide?
Intermediate
Situation read โ Same weight means Helm falls back to kind order, then name order.
What I'd do โ
- Give explicit, distinct weights to anything with a dependency (
-10,-5,0,5). - Document weights in comments.
- Keep the number of hooks small; combine steps into one Job if they are always sequential.
Why โ Relying on implicit tie-breaking is fragile.
Interview tip โ Know the sort: weight, then kind, then name.
Q74 A migration hook needs the DB password, but the Secret is created by the same chart. Is that a problem?
Advanced
Situation read โ It depends on the hook event. On post-install and pre-upgrade of later releases the Secret already exists. On pre-install it does not.
What I'd do โ
- Use
post-install,pre-upgradetiming. - If the password changes in this upgrade, the regular Secret is not yet updated at
pre-upgrade; then also render the credentials into a hook Secret (lower weight) or avoid rotating secrets in the same release as migrations. - Or use an ExternalSecret that exists independently of the release.
Why โ Regular resources are applied after pre-* hooks.
Interview tip โ "Pre hooks see the old state of regular resources" is the key insight.
Q75 How would you run integration tests against a chart in CI with a real cluster?
Intermediate
Situation read โ Unit-level checks pass, but you want proof that it installs and works.
What I'd do โ
- Create an ephemeral kind cluster in the job (
helm/kind-actionin GitHub Actions). - Load images with
kind load docker-image. helm install --wait --timeout 5mwith CI values;helm test --logs.- Also test upgrade from the previously released chart version to this one, and a rollback.
- Or use chart-testing (
ct lint-and-install --upgrade), which does install and upgrade tests for changed charts.
Why โ Install and upgrade paths fail in different ways; test both.
Interview tip โ Mention ct (chart-testing) and upgrade testing.
Q76 A hook Job keeps failing with "already exists" on the second deploy. Why?
Beginner
Situation read โ The first run's Job still exists, and Jobs are immutable, so Helm cannot create a new one with the same name.
What I'd do โ
- Add
"helm.sh/hook-delete-policy": before-hook-creation. - Delete the stale Job once:
kubectl delete job shop-migrate -n shop.
Why โ before-hook-creation removes the previous instance before each run.
Interview tip โ Note it is the default only when no delete policy annotation is set.
Q77 You want smoke tests to block promotion from staging to prod. How do you wire helm test into the pipeline?
Beginner
helm test into the pipeline?Situation read โ Promotion should be automatic only if staging is healthy.
What I'd do โ
- Staging job:
helm upgrade --install ... --atomic --wait, thenhelm test shop -n shop --logs --timeout 3m. - Fail the job on non-zero exit; prod job depends on it.
- Promote the exact same chart version and image digest to prod.
Why โ You promote an artifact that was tested, not a rebuild.
Interview tip โ "Promote the same artifact" is the key phrase.
Q78 A pre-delete hook fails and now helm uninstall is stuck. What do you do?
Intermediate
pre-delete hook fails and now helm uninstall is stuck. What do you do?Situation read โ Uninstall waits for the hook and fails, leaving the release in place (or in uninstalling).
What I'd do โ
- Inspect the hook Job logs to decide whether the cleanup matters.
- If not,
helm uninstall shop -n shop --no-hooks. - Fix the hook (permissions, timeouts) and make it tolerate already-deleted dependencies.
Why โ --no-hooks skips hooks for exactly this case.
Interview tip โ Mention that hook failures block lifecycle operations by design.
OCI, CI/CD & GitOps
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q79 Design the CI pipeline for an internal Helm chart.
Intermediate
Situation read โ Charts are code; they need tests, versioning and publishing.
What I'd do โ
- On PR:
helm lint --strictper env,helm template | kubeconform, helm-unittest,ct installon kind,helm diffagainst staging. - Enforce a version bump if chart files changed (
ct lintchecks this). - On merge:
helm package,helm pushto OCI (ECR/GHCR) with immutable tags, cosign sign. - Update the environment config (Helmfile or Argo CD) via PR for promotion.
Why โ Every published chart version is tested, immutable and traceable.
Interview tip โ Mention version-bump enforcement and immutable tags.
Q80 Your org is moving charts from ChartMuseum to an OCI registry. What changes for consumers?
Intermediate
Situation read โ OCI has no index.yaml, no helm repo add, no helm search.
What I'd do โ
- Push every existing version: loop over
.tgzfiles withhelm push. - Update dependencies to
repository: oci://registry/charts. - Update install commands to
oci://registry/charts/<name> --version X. - Update Argo CD repo config (OCI enabled, no
oci://prefix inrepoURL). - Keep ChartMuseum read-only for a deprecation period.
Why โ Same artifacts, different addressing and auth.
Interview tip โ Mention the Argo CD repoURL format quirk.
Q81 A chart version was overwritten in the registry and two clusters now run different content for "1.4.0". How do you prevent it?
Advanced
Situation read โ Mutable tags broke the assumption that a version means one content.
What I'd do โ
- Enable tag immutability on the registry (ECR
imageTagMutability: IMMUTABLE; GHCR via policy or CI check). - CI checks whether the version exists before pushing (
helm show chart oci://.../shop --version 1.4.0succeeds means fail). - Deploy by digest in sensitive environments.
- Fix: publish 1.4.1 with the intended content and upgrade both clusters.
Why โ Immutability is what makes versions meaningful for rollback and audit.
Interview tip โ Mention deploying by digest.
Q82 How would you give GitHub Actions push access to ECR for charts without long-lived keys?
Intermediate
Situation read โ Static AWS keys in CI secrets are a liability.
What I'd do โ
- Configure GitHub OIDC provider in AWS and an IAM role trusted for
repo:org/repo:ref:refs/heads/main. - Use
aws-actions/configure-aws-credentialswithrole-to-assume. aws ecr get-login-password | helm registry login --username AWS --password-stdin $REG.- Scope the role to
ecr:PutImage,ecr:InitiateLayerUpload, etc. oncharts/*only.
Why โ Short-lived, scoped credentials remove the leaked-key risk.
Interview tip โ OIDC federation is the expected answer in 2025โ2026.
Q83 You are adopting Argo CD for apps currently deployed with helm upgrade from CI. How do you migrate?
Advanced
helm upgrade from CI. How do you migrate?Situation read โ Existing objects are Helm-managed; Argo CD will apply the same manifests and track them with its own labels.
What I'd do โ
- Create the Argo CD Application with the same chart, version, values and
releaseNameso rendered names match. - Sync without prune first; Argo CD adopts existing objects (it applies over them).
- Verify the app is Synced/Healthy, then delete the Helm release records only (
kubectl delete secret -l owner=helm,name=shop), nothelm uninstall, which would delete workloads. - Remove the CI deploy step; check hooks behave correctly as Argo CD sync hooks.
Why โ You transfer ownership without recreating resources.
Interview tip โ The "delete release Secrets, not helm uninstall" detail shows real experience.
Q84 Argo CD shows a Helm app permanently OutOfSync even right after a sync. What do you look for?
Intermediate
Situation read โ Something renders differently every time, or a controller mutates fields.
What I'd do โ
argocd app diff shop-prodto see the fields.- Random or time-based template functions (
randAlphaNum,genCA,now) orlookupreturning empty; fix the chart to be deterministic or move secrets out. - Fields mutated by controllers (HPA replicas, webhook-injected values, defaulted fields); add
ignoreDifferences. - Consider
ServerSideApply=truesync option.
Why โ GitOps needs deterministic rendering.
Interview tip โ Name the random functions explicitly.
Q85 How do you promote a chart version from staging to prod in a GitOps setup?
Intermediate
Situation read โ Promotion should be a reviewed change of one value.
What I'd do โ
- Each environment's Application or Helmfile pins
targetRevision/version. - After staging tests pass, a PR bumps prod's version (manual or automated with Kargo/Renovate).
- Merge triggers Argo CD sync; rollback is reverting the PR.
Why โ Git history becomes the deploy history.
Interview tip โ Rollback equals git revert in GitOps.
Q86 Should you use Helmfile or Argo CD ApplicationSets to manage 30 platform charts?
Advanced
Situation read โ Both compose many releases; they differ in push vs pull model.
What I'd do โ
- Helmfile: CI-driven push, real Helm releases (hooks,
helm list), great diffs, simple for few clusters; needs cluster credentials in CI. - ApplicationSets: pull-based, continuous reconciliation and drift correction, UI, multi-cluster at scale; Helm used only for templating.
- For 30 charts across several clusters, I would pick Argo CD with ApplicationSets; Helmfile for small setups or bootstrap (installing Argo CD itself).
Why โ Reconciliation and multi-cluster visibility matter more as scale grows.
Interview tip โ Mention using Helmfile to bootstrap Argo CD.
Q87 Developers want to deploy feature branches as preview environments using your chart. How?
Advanced
Situation read โ Ephemeral releases per PR, cleaned up automatically.
What I'd do โ
- Argo CD ApplicationSet with the Pull Request generator: one Application per open PR, namespace
pr-<number>, values setting the image tag to the PR build and hostpr-<number>.preview.example.com. - Use small resources and an in-cluster DB subchart with no persistence.
- When the PR closes, the generator deletes the Application and its namespace.
- Without Argo CD: CI runs
helm upgrade --install shop-pr-123 -n pr-123 --create-namespaceandhelm uninstallplus namespace delete on close.
Why โ Automated lifecycle avoids orphaned preview environments.
Interview tip โ Name the ApplicationSet PR generator.
Q88 How do you make Helm deploys in CI resilient to flaky network or API timeouts?
Intermediate
Situation read โ A network blip mid-upgrade can leave a pending release.
What I'd do โ
- Pre-pull chart and dependencies early in the job (
helm pull,helm dependency build). - Use
--atomicand a Helm--timeoutlower than the CI job timeout. - On retry, first check status: if
pending-*, roll back before retrying. - Serialize deploys per environment.
Why โ Retries are only safe if the release is in a clean state.
Interview tip โ Mention checking release status before retrying.
Q89 Argo CD fails to render your chart that uses lookup to keep a generated password. What do you do?
Advanced
lookup to keep a generated password. What do you do?Situation read โ Argo CD renders without cluster access, so lookup returns empty and a new password is generated each time, causing drift (and potential outages).
What I'd do โ
- Remove secret generation from the chart; create the Secret externally (ExternalSecret, SealedSecret, or a one-time bootstrap).
- Use the chart's
existingSecretvalue to reference it. - If needed, add
ignoreDifferenceson that Secret's data while migrating.
Why โ GitOps charts must be deterministic.
Interview tip โ "lookup doesn't work in Argo CD" is a must-know fact.
Q90 How do you verify chart signatures before deployment?
Advanced
Situation read โ Supply chain: only trusted, signed charts should reach the cluster.
What I'd do โ
- Sign in CI with cosign keyless (GitHub OIDC) after
helm push. - Verify in CD:
cosign verify <chart-ref>@<digest> --certificate-identity-regexp ... --certificate-oidc-issuer ...beforehelm upgrade. - For images inside, enforce signature verification with Kyverno
verifyImagesor Sigstore policy-controller. - For classic repos,
helm install --verifywith PGP provenance.
Why โ Verifying at deploy time blocks tampered or unofficial artifacts.
Interview tip โ Mention both chart and image signing.
Q91 CI deploys with helm upgrade and also Argo CD watches the same namespace. Is that OK?
Intermediate
helm upgrade and also Argo CD watches the same namespace. Is that OK?Situation read โ Two controllers owning the same objects will fight: Argo CD self-heal reverts CI changes, or CI overwrites Argo CD state.
What I'd do โ
- Pick one owner per release. Remove the CI deploy, or exclude the namespace from Argo CD.
- CI can still build, push charts and images, and update Git; Argo CD applies.
Why โ Single ownership is the foundation of GitOps.
Interview tip โ "One writer per resource" is the principle.
Q92 How would you bootstrap a brand new cluster with platform charts?
Advanced
Situation read โ Chicken-and-egg: Argo CD itself must be installed somehow.
What I'd do โ
- Terraform creates the cluster, then a Helm provider or Helmfile installs Argo CD (and CRDs).
- Argo CD's root "app of apps" or ApplicationSet installs everything else (ingress, cert-manager, external-dns, monitoring) with sync waves for ordering.
- Argo CD then manages itself from Git.
Why โ Minimal imperative bootstrap; everything after is declarative.
Interview tip โ Mention "app of apps" and sync waves.
Secrets & Security
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q93 A secret was committed in plaintext in values-prod.yaml. What do you do?
Beginner
values-prod.yaml. What do you do?Situation read โ The secret is compromised the moment it is pushed; removing it from Git does not un-leak it.
What I'd do โ
- Rotate the credential immediately (database password, API key).
- Remove it from the file; move it to a SOPS-encrypted file or a secret manager.
- Optionally rewrite history (
git filter-repo), but assume it is already copied. - Add secret scanning (gitleaks, GitHub push protection) to block recurrence.
Why โ Rotation is the only real fix.
Interview tip โ Say "rotate first" before anything else.
Q94 Who can read secrets passed to Helm, and how do you reduce exposure?
Intermediate
Situation read โ Values containing secrets are stored in the release Secret, readable by anyone with get secrets in the namespace; they also appear in --debug output and CI logs.
What I'd do โ
- Restrict
get/list secretsvia RBAC; developers get read access to other resources only. - Use
existingSecretreferences so values contain names, not secret values. - Use External Secrets Operator so values never contain secrets.
- Never run
--debugorhelm get valuesin shared CI logs for prod.
Why โ The release record is a copy of every secret you pass through Helm.
Interview tip โ Knowing the release Secret leak path is a strong signal.
Q95 Set up helm-secrets with SOPS and AWS KMS for prod and age for dev.
Intermediate
Situation read โ Different keys per environment; prod decryptable only by the prod deploy role.
What I'd do โ
.sops.yaml:
creation_rules:
- path_regex: secrets/prod/.*\.yaml$
kms: arn:aws:kms:ap-south-1:123456789012:key/abcd-1234
- path_regex: secrets/dev/.*\.yaml$
age: age1x7...devsops -e -i secrets/prod/shop.yaml, commit.- CI prod role has
kms:Decrypton that key only; dev CI usesSOPS_AGE_KEYfrom CI secrets. - Deploy with
-f secrets://secrets/prod/shop.yaml.
Why โ Encryption keys enforce who can deploy which environment's secrets.
Interview tip โ Mention per-environment key separation.
Q96 A chart from the internet requests cluster-admin. How do you evaluate and contain it?
Advanced
Situation read โ Many charts over-request RBAC.
What I'd do โ
helm templateand review every ClusterRole/Role and binding.- Check whether namespaced mode exists (
rbac.clusterWide: false,watchNamespace). - If not, replace with a reduced ClusterRole via values or a post-renderer.
- Install in a dedicated namespace with NetworkPolicies, Pod Security restricted, and image signature verification.
Why โ Rendered output tells you exactly what you are granting.
Interview tip โ Always review rendered RBAC before installing third-party charts.
Q97 Your security team asks you to scan Helm charts for misconfigurations in CI. How?
Beginner
Situation read โ Misconfigurations live in rendered manifests.
What I'd do โ
trivy config ./shop(scans Helm charts directly) orhelm template ... | checkov -f -/kube-linter lint ./shop.- Run per environment's values, since prod settings differ.
- Fail on HIGH findings; document exceptions in code.
Why โ Scanning rendered output reflects what will actually run.
Interview tip โ Mention scanning with each environment's values.
Q98 How do you rotate a database password managed through Helm without downtime?
Advanced
Situation read โ Changing the password in values updates the Secret, but the DB still has the old one, and pods need restarting.
What I'd do โ
- Prefer dual credentials: create a second DB user or set the new password on the DB first (ALTER ROLE).
- Update the secret source (SOPS file or Secrets Manager), deploy; checksum annotation rolls pods with the new password.
- Verify, then revoke the old password.
- With External Secrets plus Reloader, rotation happens without a Helm deploy.
Why โ Rotation must be coordinated between the DB and consumers.
Interview tip โ Say "change at the source first, then roll consumers, then revoke".
Q99 Your CI service account for Helm has cluster-admin "because it was easier". How do you fix it?
Intermediate
Situation read โ A compromised pipeline would own the cluster.
What I'd do โ
- Per-namespace ServiceAccounts or IAM-mapped roles with a Role covering only the kinds the chart renders plus Secrets (release storage).
- List needed kinds:
helm template ... | yq '.kind' | sort -u. - Separate platform pipelines (which need cluster-scoped kinds) from app pipelines.
- Audit with
kubectl auth can-i --list --as system:serviceaccount:ci:deployer -n shop.
Why โ Least privilege limits blast radius of CI compromise.
Interview tip โ Mention deriving the permission list from rendered kinds.
Q100 How do you stop someone installing an unapproved chart into production?
Advanced
Situation read โ Helm itself does not enforce sources; the cluster must.
What I'd do โ
- No human write access to prod; only CI or Argo CD with restricted Argo CD Projects (
sourceReposallow-list). - Admission policies (Kyverno) requiring images from approved registries and signed.
- Network egress restrictions so CI pulls charts only from the internal registry mirror.
- Audit logs and alerts on new Helm release Secrets created outside CI identities.
Why โ Controls at the deploy path and admission layer, not trust in users.
Interview tip โ Argo CD Project sourceRepos is a nice specific detail.