KCNA Helm and Package Management 4 — Questions and Answers
Question 1: What is the difference between `helm install` and `helm upgrade` when the `--force` flag is used?
- --force skips all pre-install hooks
- --force deletes and re-creates resources that cannot be patched in place (Correct answer)
- --force bypasses Helm version compatibility checks
- --force ignores all validation errors from the API server
Correct answer: --force deletes and re-creates resources that cannot be patched in place
`--force` causes Helm to delete and recreate resources that fail a standard patch/update, useful when resource specs have immutable fields that changed.
Question 2: How can you override a nested value in values.yaml from the `helm install` command line?
- --set parent.child=value (Correct answer)
- --values parent/child=value
- --override parent:child:value
- --param parent.child value
Correct answer: --set parent.child=value
`--set` accepts dot-notation paths such as `parent.child=value` to override nested keys in values.yaml without editing the file.
Question 3: What is an OCI registry in the context of Helm charts?
- A Kubernetes operator that manages Helm releases
- A container image registry used to store and distribute Helm charts as OCI artifacts (Correct answer)
- An open-source CI server that tests Helm charts
- A Helm plugin for validating chart compliance
Correct answer: A container image registry used to store and distribute Helm charts as OCI artifacts
Helm supports storing charts in OCI-compliant registries (like Docker Hub or ECR) as artifacts, using `helm push` and `helm pull oci://` references.
Question 4: Which Helm command packages a chart directory into a versioned `.tgz` archive for distribution?
- helm archive
- helm compress
- helm package (Correct answer)
- helm bundle
Correct answer: helm package
`helm package` compresses a chart directory into a `<name>-<version>.tgz` tarball that can be uploaded to a chart repository or OCI registry.
Question 5: What is the purpose of the `NOTES.txt` file in a Helm chart's `templates/` directory?
- Documents the chart's changelog for version history
- Rendered and displayed to the user after a successful install or upgrade (Correct answer)
- Stores comments that are stripped before deployment
- Provides machine-readable metadata consumed by Helm plugins
Correct answer: Rendered and displayed to the user after a successful install or upgrade
`NOTES.txt` is a template rendered after install/upgrade and printed to the user's terminal, typically containing usage instructions or next steps.
Question 6: What Helm concept allows one chart to include and manage other charts as dependencies?
- Helm plugins
- Subcharts (Correct answer)
- Helm hooks
- Library charts
Correct answer: Subcharts
Subcharts (also called child charts) are charts listed under `dependencies` in Chart.yaml and packaged inside the parent chart's `charts/` directory.
Question 7: Which annotation marks a Kubernetes resource so Helm adopts management of it even if not originally installed by Helm?
- helm.sh/managed: 'true'
- meta.helm.sh/release-name and meta.helm.sh/release-namespace (Correct answer)
- app.kubernetes.io/managed-by: Helm
- helm.sh/adopt: 'true'
Correct answer: meta.helm.sh/release-name and meta.helm.sh/release-namespace
Setting both `meta.helm.sh/release-name` and `meta.helm.sh/release-namespace` annotations (along with `app.kubernetes.io/managed-by: Helm` label) tells Helm to adopt an existing resource.
What is the difference between `helm install` and `helm upgrade` when the `--force` flag is used?