Helm namespaces

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