Cloud / HELM Interview Questions
Explain Helm template syntax: Go templates, values injection, and pipeline functions with examples.
Helm uses Go templates enhanced with Sprig functions (over 60+ functions) to generate Kubernetes manifests. Templates live in the templates/ directory.
Basic Values Injection: In values.yaml: replicaCount: 3. In deployment.yaml: spec: replicas: {{ .Values.replicaCount }}. The dot (.) represents the root context.
Control Structures: {{- if .Values.persistence.enabled }}...{{- end }} with hyphens (-) trimming whitespace.
Pipelines and Functions: image: "{{ .Values.image.repository | default "nginx" }}:{{ .Values.image.tag | quote }}". Common functions: quote, default, required, toYaml, nindent.
nindent X is critical - it adds a newline then X spaces. Example: {{ include "myapp.labels" . | nindent 2 }}.
Variables: {{- $replicas := .Values.replicaCount | int }} capture values. Sprig provides eq/ne/lt/le/gt/ge comparisons.
Lookup Function: queries Kubernetes API during rendering for conditional logic based on cluster state.
More Related questions...