<p>I'm creating a Multi-Tenancy Kubernetes infrastructure. 
I created a Helm Chart with my app, and now I need automate the helm chart installation when a new namespace is created.</p>

<p>For example,  when the namespace <code>client1</code> is create I need to  run <code>helm install myrepo/myapp --name client1</code>.</p>

<p>How can i get the new namespace creation event? And the namespace name?</p>

Patrick Barattin
<p>You can either keep running a script which executes <code>kubectl get namespace</code> every since a while and compares the current result with the old result. When you find out a new namespace created, you can then execute <code>helm install myrepo/myapp --name client1</code>. Or you can run an application in your cluster. What the application does is basically listing all namespaces in the cluster, comparing the current with the cached, if a new namespace found, then call helm client to install your app. For more information, if you are using golang, I would recommend you to use <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">kubernetes client-go</a> to get the list of namespaces in the cluster and you can refer to the open resource project <a href="https://github.com/banzaicloud/pipeline/tree/master/helm" rel="nofollow noreferrer">pipeline</a> for the helm client-go part to install your app.</p>
