docs: document ownership annotations in install and upgrade help text

Add a RESOURCE OWNERSHIP section to the helm install and helm upgrade
command descriptions explaining the meta.helm.sh/release-name and
meta.helm.sh/release-namespace annotations (and app.kubernetes.io/managed-by
label) that Helm uses to track resource ownership, and document the
--take-ownership flag for adopting pre-existing resources.

Fixes #12869

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Arnav Nagzirkar <113314200+arnavnagzirkar@users.noreply.github.com>
pull/32199/head
Arnav Nagzirkar 4 weeks ago
parent 609e1ca72c
commit 4036737849

@ -127,6 +127,20 @@ supply a version number with the '--version' flag.
To see the list of chart repositories, use 'helm repo list'. To search for
charts in a repository, use 'helm search'.
RESOURCE OWNERSHIP
When Helm installs a chart, it adds the following metadata to every Kubernetes
resource it creates:
- Label: app.kubernetes.io/managed-by=Helm
- Annotation: meta.helm.sh/release-name=<release-name>
- Annotation: meta.helm.sh/release-namespace=<release-namespace>
These are used to track ownership. If a resource already exists in the cluster
without these annotations, Helm will refuse to install and return an error. To
adopt pre-existing resources into the release, use '--take-ownership'. Helm will
then add the ownership metadata and manage those resources going forward.
`
func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {

@ -80,6 +80,19 @@ or '--set' flags. Priority is given to new values.
The --dry-run flag will output all generated chart manifests, including Secrets
which can contain sensitive values. To hide Kubernetes Secrets use the
--hide-secret flag. Please carefully consider how and when these flags are used.
RESOURCE OWNERSHIP
Helm tracks ownership of Kubernetes resources using the following metadata:
- Label: app.kubernetes.io/managed-by=Helm
- Annotation: meta.helm.sh/release-name=<release-name>
- Annotation: meta.helm.sh/release-namespace=<release-namespace>
During an upgrade, if a resource exists in the cluster without these annotations
(or with annotations pointing to a different release), Helm will return an error.
To take ownership of such resources and have Helm manage them going forward, use
'--take-ownership'.
`
func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {

Loading…
Cancel
Save