Review app deployment - Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists.
After upgrading from helm chart v4.6.3 to v4.12.0 in !62372 (merged), review apps that have been deployed using v4.6.3 cannot be upgraded to v4.12.0.
When trying to helm upgrade --install
where there is an existing release created using v4.6.3
, the command fails with the following error:
Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict: namespace: review-apps, name: release-name-minio, existing_kind: networking.k8s.io/v1beta1, Kind=Ingress, new_kind: networking.k8s.io/v1beta1, Kind=Ingress
This can be reproduced by first deploying using helm chart v4.6.3, then repeating it using v4.12.0.
When using helm
CLI v3.5.4
, it shows a more descriptive message with corrective action:
Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: Ingress "alberts-test-release-minio" in namespace "review-apps" 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 "alberts-test-release"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "review-apps"
Proposed solution
- Upgrade build image to use latest helm & kubectl version. Currently the cluster is on kubernetes
v1.17.*
, but the kubectl used by the job is stillv1.14.*
. There's already an updated one introduced in gitlab-build-images!387 (merged)
Edited by Albert