How to create a namespace first?

2/20/2020

I have a custom chart, that should first create a namespace before install dependencies.
How to force Helm first to create namespace before install dependencies?

-- zero_coding
kubernetes
kubernetes-helm

1 Answer

2/20/2020

If you are using a custom chart, if you put a namespace template in there, it will apply that one first.

If you are using a third party chart, you can pull it in as a dependency to a one file chart that creates the namespace.

If you don't need anything special, I believe helm install -n MYNAMESPACE mychart will create a default namespace for you (but not sure, and the behavior may have changed anyway)

-- Paul Becotte
Source: StackOverflow