fluxcd / flux

Successor: https://github.com/fluxcd/flux2
https://fluxcd.io
Apache License 2.0
6.9k stars 1.08k forks source link

annotation validation error: key "meta.helm.sh/release-namespace" must equal "flux": current value is "default" #3582

Closed MLHafizur closed 2 years ago

MLHafizur commented 2 years ago

$ helm upgrade -i flux fluxcd/flux --set git.url=git@github.com:MLHafizur/Airflow_On_EKS --namespace flux

Release "flux" does not exist. Installing it now. Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "flux" 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 "flux": current value is "default

What is the solution of this issue?

kingdonb commented 2 years ago

It looks like you have previously installed the Flux helm chart globally on this cluster with the --namespace option set to default, perhaps it was missing from the command altogether. This time it's set to flux and the ClusterRole already shows an existing Flux instance on the cluster. (Maybe it's still in use? Check with other admins if you are not the only owner of this cluster.) Multiple Flux v1 instances can exist on the same cluster, but it could make answering your question a bit more complicated if that was the case.

You can remove the annotation from the ClusterRole (and any other resources that Flux created that will have this issue) then take over with your new installation, or you can install instead in the Default namespace.

I would not recommend proceeding either way if you can instead migrate to Flux v2, which I'm obliged to recommend as we are in maintenance mode here as the pinned issue mentions, and we will not likely be able to support Flux v1 forever. The most developer attention is on Flux v2 and it is where all new feature development goes. Users are recommended to upgrade ASAP for great features like server-side apply, validation, a new better approach to multi-tenancy and multi-cluster.

Please review the migration timetable and consider upgrading: https://fluxcd.io/docs/migration/timetable/

There is also a migration guide: https://fluxcd.io/docs/migration/flux-v1-migration/