Kubernetes Container Orchestration Helm and Package Management 5 — Questions and Answers
Question 1: What is the Helm `--set` flag limitation compared to `-f` (values file)?
- --set cannot override nested values
- --set values are not persisted in release history
- --set cannot express complex structures like arrays easily and becomes unwieldy for many values (Correct answer)
- --set only works during install, not upgrade
Correct answer: --set cannot express complex structures like arrays easily and becomes unwieldy for many values
While `--set` is convenient for simple overrides, it has awkward syntax for arrays and multiline strings, making values files preferable for complex configurations.
Question 2: What is Helmfile?
- Helm's built-in declarative configuration format introduced in v3.5
- A third-party tool for declaratively managing multiple Helm releases as code (Correct answer)
- A Helm plugin for generating values files from external secrets
- The YAML format used by Helm to define chart dependencies
Correct answer: A third-party tool for declaratively managing multiple Helm releases as code
Helmfile is an open-source tool that lets you declare multiple Helm releases with their values and dependencies in a single `helmfile.yaml` for GitOps workflows.
Question 3: Which annotation on a Kubernetes resource tells Helm NOT to delete it when the release is uninstalled?
- helm.sh/preserve: "true"
- helm.sh/resource-policy: keep (Correct answer)
- helm.sh/lifecycle: permanent
- helm.sh/retain-on-delete: "true"
Correct answer: helm.sh/resource-policy: keep
The `helm.sh/resource-policy: keep` annotation instructs Helm to skip deletion of that resource during `helm uninstall` or upgrades that remove it.
Question 4: What does the `helm show values` command display?
- The current overridden values for a deployed release
- The default values defined in the chart's values.yaml (Correct answer)
- A diff between default and current release values
- All values available across all installed releases
Correct answer: The default values defined in the chart's values.yaml
`helm show values <chart>` prints the default `values.yaml` from a chart, which is useful for understanding available configuration options.
Question 5: In Helm template conditionals, what does `{{- if .Values.ingress.enabled }}` accomplish?
- Checks if the ingress field exists in the schema
- Renders the block only when ingress.enabled is truthy, stripping leading whitespace (Correct answer)
- Iterates over all ingress configurations in the values
- Validates the ingress value against allowed options
Correct answer: Renders the block only when ingress.enabled is truthy, stripping leading whitespace
The `{{- if }}` block renders its content only when the condition is truthy, and the leading dash trims whitespace before the action tag.
Question 6: How does Helm handle chart schema validation?
- Helm validates charts against the Kubernetes OpenAPI schema automatically
- Chart authors can provide a `values.schema.json` JSON Schema file to validate user-supplied values (Correct answer)
- Helm uses a built-in DSL in values.yaml to declare validation rules
- Schema validation requires installing the helm-schema plugin separately
Correct answer: Chart authors can provide a `values.schema.json` JSON Schema file to validate user-supplied values
If a chart includes `values.schema.json`, Helm validates user-provided values against it during install and upgrade, giving clear error messages for invalid configurations.
Question 7: What is the purpose of `helm dependency build` vs `helm dependency update`?
- `build` compiles templates while `update` downloads dependencies
- `build` uses the existing `Chart.lock` to download pinned versions; `update` resolves and downloads latest matching versions and regenerates `Chart.lock` (Correct answer)
- `build` is for local charts while `update` fetches from remote repositories
- They are aliases for the same operation in Helm 3
Correct answer: `build` uses the existing `Chart.lock` to download pinned versions; `update` resolves and downloads latest matching versions and regenerates `Chart.lock`
`helm dependency build` reproduces the exact dependency versions from `Chart.lock`, while `helm dependency update` re-resolves dependencies from `Chart.yaml` and updates `Chart.lock`.
What is the Helm `--set` flag limitation compared to `-f` (values file)?