-
Type: Task
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Continuous Integration
-
Tags:
-
Sprint:nxplatform #89
-
Story Points:1
In some cases, for instance platform-ci, we would like to not pass a namespace as argument of the Helmfile commands, to fully rely on the namespace defined for a given release.
E.g., with the following release:
releases: - name: ingress-nginx chart: ingress-nginx/ingress-nginx version: ~4.6.1 condition: ingressNginx.enabled namespace: ingress-nginx values: - charts/ingress-nginx/values.yaml
Running:
helmfile --helm-binary /usr/bin/helm3 --file helmfile.yaml --namespace=platform --environment production sync
Results in the following subcommand:
/usr/bin/helm3 upgrade --install --reset-values \ ingress-nginx ingress-nginx/ingress-nginx \ --version 4.6.1 \ --wait --timeout 480s --atomic \ --create-namespace \ --namespace platform \ --values /tmp/helmfile3492130409/platform-ingress-nginx-values-688866d686 \ --history-max 10
Which fails with:
Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "ingress-nginx" 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 "platform": current value is "ingress-nginx"
Not passing the --namespace to the helmfile argument won't work because the shared library adds one by default, resulting on:
Building dependency release=jenkins-extra, chart=charts/jenkins-extra in ./helmfile.yaml: release(s) "platform-platform-ci-pr-106-1/jenkins" depend(s) on an undefined release "platform-staging/jenkins-extra". Perhaps you made a typo in "needs" or forgot defining a release named "jenkins-extra" with appropriate "namespace" and "kubeContext"?