Helm namespaces

2019, Jan 16    

I’ve been creating my own Helm chart for an application. I initially tried to shoe-horn the namespace into the values.yaml and then pull it through into the service and deployment yaml files. Turns out that isn’t a good way to do it, which is kind of obvious when you think about it. It’s a common scenario for an application to exist multiple times in the same cluster, separated by namespace.

When you install the chart for the first time, provide the name of the namespace which already exists.
Here’s the steps from Creating a new Helm Chart to deploying and then upgrading it.

helm create nginx-webapp<br /> #tweak the values.yml<br /> cd nginx-webapp/<br /> kubectl create namespace whatthehack-webapps2<br /> helm install --name nginx-webapp . --namespace whatthehack-webapps2<br /> #make a change to the application<br /> helm upgrade nginx-webapp .<br /> kubectl get svc --all-namespaces<br /> helm upgrade nginx-webapp .