You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently createNamespace doesn't set any metadata. Please add the following:
apiVersion: v1kind: namespacemetadata:
name: foolabels:
app: HEREchart: HEREheritage: Tillerrelease: HERE
Reacted by Faheem Nadeem, Andy Suderman, vitalijsvolodenkovsmagebit, Robert Van Voorhees, David J. M. Karlsen, Luke Alexander, Greg Taylor, Marc Cortinas, Pavel, James Marino and 21 more
I wish to add custom labels to namespaces, or maybe the default best practices one will suffice as well. Currently don't know of a way to do it with namespace being created by helm automatically i.e. using --namespace. Nor I believe I can add a namespace manifest like here to helm charts. My use-case is this: prometheus-operator/prometheus-operator#1331 (comment). Whereby namespaces are being selected using LabelSelector and we are unable to because of missing labels on namespaces.
Reacted by Mike Dite, Andy Suderman, Horia, Ben Lin , Akito, Erik, Himanshu, Vadim Bauer, Kirin nee, Karim Heraud and 7 more
+1 to this. I want to use a ValidatingWebhookConfiguration and need to exclude validation on the namespace the release is deployed into for bootstrapping purposes.
The namespaceSelector only supports selecting based on labels, so I need to somehow label the release namespace.
Happy to put in the work for this if someone can confirm it's an acceptable request/how it should be done.
Reacted by Andy Suderman, Faheem Nadeem, Greg Taylor, Marc Cortinas, Akito, Victor Arbues, Kirin nee, Karim Heraud, Giancarlo, ash-ber and 1 more
Custom labels will be very helpful for labelling namespaces for istio sidecar injection using the mutating webhook admission controller as well.
Reacted by J. Hollinshead, Jakub Kulich, Faheem Nadeem, David Stockton, Shane Ramey, Bianca Jiang, James Collins, Pierre-Louis Gottfrois, Ben Lin , Pascal Gauthier and 57 more
Since #4231 is merged, it is now possible to do this sort of thing (from Helm 2.10 onwards) - provided that the namespace does not already exist when the user first runs helm install.
It's a workaround, but using helmfile allows you to define hooks that are executed before a chart is deployed, see for example roboll/helmfile#538 for the use case defined here…
Closing as a wontfix. The namespace creation code was removed from Helm 3 to align with Kubernetes best practices. See #5753 (comment) for a more detailed explanation. Thanks!
Reacted by Andy Suderman
Reacted by Erik, Emma Doyle, Vicente Herrera, Rajan Gupta and Ihor Hruzdiev
We re-introduced —create-namespace with the caveat that we will not be planning to support this use case due to the complexity of manipulating the namespace.
If you want to apply custom labels or annotations to the namespace, please use kubectl create namespace or some other method instead.
Reacted by Andy Suderman, Stéphane Benoit and Enrique Tejeda
Reacted by Akito, Bob Taylor, Shashank, jonasv, achupryn, Thor Anker Kvisgård Lange, c0r3xxx, TomGouderGFT, Andrey Lebedev, Timothy Chen and 195 more
Reacted by Stefan Lasiewski, Zia-Eurus, vinmazzi, 刘平, Joshua Sleeper, Rommel, Julien Laurenceau, Dr., Vicente Herrera, palmobar, balagurrr and 4 more
Activity
sathieu commentedon Feb 13, 2018
Currently createNamespace doesn't set any metadata. Please add the following:
faheem-nadeem commentedon Jun 4, 2018
I wish to add custom labels to namespaces, or maybe the default best practices one will suffice as well. Currently don't know of a way to do it with namespace being created by helm automatically i.e. using
--namespace. Nor I believe I can add a namespace manifest like here to helm charts. My use-case is this: prometheus-operator/prometheus-operator#1331 (comment). Whereby namespaces are being selected usingLabelSelectorand we are unable to because of missing labels on namespaces.munnerz commentedon Jun 16, 2018
+1 to this. I want to use a ValidatingWebhookConfiguration and need to exclude validation on the namespace the release is deployed into for bootstrapping purposes.
The namespaceSelector only supports selecting based on labels, so I need to somehow label the release namespace.
Happy to put in the work for this if someone can confirm it's an acceptable request/how it should be done.
sudermanjr commentedon Jun 26, 2018
Custom labels will be very helpful for labelling namespaces for istio sidecar injection using the mutating webhook admission controller as well.
kvudata commentedon Jun 27, 2018
I had the same issue, I was able to get things to work using a chart pre-install hook e.g. https://gist.github.com/kvudata/12ba57ae1e7f01799aaa7f36350a9b2e.
sudermanjr commentedon Sep 5, 2018
@kvudata Does that work if the namespace is being created by helm, or only if the namespace already exists when you run the
helm install?munnerz commentedon Sep 6, 2018
Since #4231 is merged, it is now possible to do this sort of thing (from Helm 2.10 onwards) - provided that the namespace does not already exist when the user first runs
helm install.kvudata commentedon Sep 6, 2018
@sudermanjr, when I tested it worked in both scenarios (whether the namespace exists already or not).
jordan-da commentedon Oct 11, 2018
Is there a way to add your own labels to a namespace helm is creating for you?
sudermanjr commentedon Oct 11, 2018
@jordan-da See the gist from kvudata above.
jordan-da commentedon Oct 11, 2018
@sudermanjr yea, I saw it (and commented on it).. I am just so surprised! Seems like a worthy one off thing to have.
I ended up creating my namespace before running helm, with the labels I required. Speaking of one offs.
AlexShemeshWix commentedon Jan 24, 2019
Im voting up this one.
Any plans to implement? The solution from gist is complicated.
victornoel commentedon Apr 4, 2019
It's a workaround, but using helmfile allows you to define hooks that are executed before a chart is deployed, see for example roboll/helmfile#538 for the use case defined here…
sudermanjr commentedon Apr 4, 2019
Another workaround would be to use Reckoner hooks as well.
https://github.com/reactiveops/reckoner#hooks
(Full disclosure, I work for the company that wrote Reckoner)
rbq commentedon May 28, 2019
I'm currently trying to work around this issue by deploying Namespaces via magic namespace chart (with Tiller and Service Accounts disabled).
bacongobbler commentedon Oct 12, 2019
Closing as a wontfix. The namespace creation code was removed from Helm 3 to align with Kubernetes best practices. See #5753 (comment) for a more detailed explanation. Thanks!
gofman8 commentedon Sep 22, 2020
Hi all! Please reopen due to #7648
bacongobbler commentedon Sep 22, 2020
We re-introduced —create-namespace with the caveat that we will not be planning to support this use case due to the complexity of manipulating the namespace.
If you want to apply custom labels or annotations to the namespace, please use
kubectl create namespaceor some other method instead.Delete namespace.yaml