-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add metadata to created namespace #3503
Comments
Currently createNamespace doesn't set any metadata. Please add the following: apiVersion: v1
kind: namespace
metadata:
name: foo
labels:
app: HERE
chart: HERE
heritage: Tiller
release: HERE |
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 |
+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. |
Custom labels will be very helpful for labelling namespaces for istio sidecar injection using the mutating webhook admission controller as well. |
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. |
@kvudata Does that work if the namespace is being created by helm, or only if the namespace already exists when you run the |
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 |
@sudermanjr, when I tested it worked in both scenarios (whether the namespace exists already or not). |
Is there a way to add your own labels to a namespace helm is creating for you? |
@jordan-da See the gist from kvudata above. |
@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. |
Im voting up this one. |
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… |
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) |
I'm currently trying to work around this issue by deploying Namespaces via magic namespace chart (with Tiller and Service Accounts disabled). |
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! |
Hi all! Please reopen due to #7648 |
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 |
* Namespace should be created with --create-namespace per helm/helm#3503 * Fixed some SA bugs to work with Terraform wrapper.
No description provided.
The text was updated successfully, but these errors were encountered: