`Error: INSTALLATION FAILED: Unable to continue with install: CustomResourceDefinition "certificates.cert-manager.io" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "cert-manager": current value is "kube-system"`
AdvancedTroubleshootingInstall & Upgrade Failures
Answer
Likely causes → A previous installation of the same software in another namespace (or another release) owns the cluster-scoped CRDs.
Diagnose →
kubectl get crd certificates.cert-manager.io -o yaml | yq '.metadata.annotations, .metadata.labels'
helm list -A | grep cert-manager
Fix → Decide the single owner. Either uninstall the old release first (careful: deleting CRDs deletes all Certificates), or re-annotate the CRDs to the new release, or install the chart with CRD installation disabled (crds.enabled=false / installCRDs=false) and manage CRDs separately.
Prevent → Cluster-wide components are installed once by the platform team; CRDs managed in their own pipeline.
More on Install & Upgrade Failures
`Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress`Beginner`Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: Service "shop-api" in namespace "shop" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "shop"`Advanced`Error: INSTALLATION FAILED: cannot re-use a name that is still in use`Beginner`Error: UPGRADE FAILED: context deadline exceeded`Beginner`Error: UPGRADE FAILED: release shop failed, and has been rolled back due to atomic being set: context deadline exceeded`Intermediate`Error: UPGRADE FAILED: cannot patch "shop-api" with kind Deployment: Deployment.apps "shop-api" is invalid: spec.selector: Invalid value: v1.LabelSelector{...}: field is immutable`Advanced