KCNA Helm and Package Management 5 — Questions and Answers
Question 1: What is a Helm library chart and how does it differ from an application chart?
- A chart stored in a private registry requiring authentication
- A chart that provides reusable templates but deploys no Kubernetes resources itself (Correct answer)
- A chart used only for testing purposes in CI pipelines
- A stripped-down chart that omits values.yaml
Correct answer: A chart that provides reusable templates but deploys no Kubernetes resources itself
Library charts (type: library in Chart.yaml) define shared template helpers for other charts to use but cannot be installed directly because they produce no manifests.
Question 2: What happens to Helm release history when `helm uninstall` is run without the `--keep-history` flag?
- The release history is archived to a ConfigMap in the kube-system namespace
- All Kubernetes resources and the release history are permanently deleted (Correct answer)
- Only the Kubernetes resources are removed; history is kept for 30 days
- The release is marked as uninstalled but history remains indefinitely
Correct answer: All Kubernetes resources and the release history are permanently deleted
Without `--keep-history`, `helm uninstall` removes both the deployed Kubernetes resources and the release history Secrets, making rollback impossible.
Question 3: Which Helm template function should be used instead of `include` when you need to pipe the result through other functions?
- template
- include (Correct answer)
- toYaml
- render
Correct answer: include
`include` returns the rendered string so it can be piped (e.g., `include "mytemplate" . | indent 4`), whereas `template` outputs directly and cannot be piped.
Question 4: What is the role of `helm lint` in chart development?
- Deploys the chart to a test namespace and validates runtime behavior
- Statically checks a chart for common errors, misconfigurations, and best-practice violations (Correct answer)
- Compares a chart's rendered output against a previous release
- Verifies that all chart dependencies are available in configured repositories
Correct answer: Statically checks a chart for common errors, misconfigurations, and best-practice violations
`helm lint` performs static analysis on a chart directory, reporting errors and warnings about structure, required fields, and template issues before deployment.
Question 5: When using `helm upgrade` with `--atomic`, what occurs if the upgrade fails?
- Helm waits indefinitely for resources to become healthy before timing out
- The upgrade is automatically rolled back to the previous successful release (Correct answer)
- The failed release is left in place for manual debugging
- Helm deletes the entire release and its history
Correct answer: The upgrade is automatically rolled back to the previous successful release
`--atomic` combines `--wait` with automatic rollback: if any resource fails to become ready within the timeout, Helm rolls the release back to its previous revision.
Question 6: How does Helm differentiate between the chart version and the application version it packages?
- The chart version is in values.yaml; application version is in Chart.yaml
- Chart.yaml has a `version` field for the chart and an `appVersion` field for the application (Correct answer)
- Both versions share the same field and must always match
- The application version is read from the container image tag at deploy time
Correct answer: Chart.yaml has a `version` field for the chart and an `appVersion` field for the application
`Chart.yaml` uses `version` to track the chart's own release cadence and `appVersion` as an informational field indicating the upstream application version being packaged.
Question 7: What is the purpose of the `helm test` command?
- Renders templates and validates YAML syntax without deploying
- Runs test hook Pods defined in the chart to verify a release is functioning correctly (Correct answer)
- Compares current cluster state against the expected Helm manifest
- Benchmarks chart installation time against a baseline
Correct answer: Runs test hook Pods defined in the chart to verify a release is functioning correctly
`helm test <release>` executes Pods annotated with `helm.sh/hook: test` to perform post-deployment validation, reporting pass or fail based on Pod exit codes.
What is a Helm library chart and how does it differ from an application chart?