Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot override "meta.helm.sh/release-name" ? #343

Open
iamFrancescoFerro opened this issue May 7, 2024 · 0 comments
Open

Cannot override "meta.helm.sh/release-name" ? #343

iamFrancescoFerro opened this issue May 7, 2024 · 0 comments

Comments

@iamFrancescoFerro
Copy link

iamFrancescoFerro commented May 7, 2024

Hello,

We have a system that is able to deploy a PR. The release name is the name of the application + git hash
eg: helm install my-api-HASH1
Each PR can be deploy and this allows us to have a full proper e2e before merging.

We also have one single shared namespace for the application. This is a nice way to have all the PRs into one namespace (easy to cleanup if needed), avoid resources pollution but most importantly allows us to for example automatically store secrets into one namespace vs (100 different Namespaces)

However we are facing an issue because Helm automatically adds this annotation:
meta.helm.sh/release-name={chart's release-name}

This is causing an issue because it now makes the namespace non unique and we get this if we want to deploy a new PR
helm install my-api-HASH2

Unable to continue with install: Namespace "mynamespace" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "my-api-HASH2": current value is "my-api-HASH1"

We have of course tried this adding this meta.helm.sh/release-name": "mynamespace" but this gets ignored by Helm.

Is there a way somehow to override that value ? Is there an other way that would allow us to keep one single namespace for multiple releases ?

UPDATE: Spent some time searching around and I read in the best practices that it was better to not specify the namespace: .. field on the resources and let helm handle it.

Indeed, if I remove the Namespace resource and remove all the namespace: .. field it works only if I passes --namespace XXX --create-namespace

However now I'd like to know if there is a way to add custom labels to the namespace Helm is creating?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant