<p>I found a lot of information on how to give helm permission to create resources in a particular namespace. </p>

<p>I am trying to see if I can create namespaces on the fly(with random names) and then use helm to install and delete resources inside the namespace.</p>

<p>My idea is to create a namespace with name such as Fixedsuffix-randomprefix and then allow helm to create all resources inside it. Is this possible ?</p>

<p>I can create a clusterrole and clusterrolebinding to allow tiller's serviceaccount to create namespaces, but I am not able to figure out how to have a serviceaccount that could create resources in the particular namespace( mainly because this serviceaccount to create resources cant would have to be created when the namespace is created and then assigned to tiller pod).</p>

<p>TIA</p>

The_Lost_Avatar
<p>My question is why would you create sa, clusterrole and rolebinding to do that? Helm has it´s own resources which allow him to install and delete resources inside new namespace.</p>

<blockquote>
  <p>My idea is to create a namespace with name such as Fixedsuffix-randomprefix and then allow helm to create all resources inside it. Is this possible ?</p>
</blockquote>

<p>Yes, you can create your new namespace and use helm to install everything in this namespace.Or even better you can just use helm install and it will create new namespace for you. For that purpose helm have <a href="https://helm.sh/docs/helm/helm_install/#options-inherited-from-parent-commands" rel="nofollow noreferrer">helm install</a> --namespace.</p>

<blockquote>
  <p>-n, --namespace string                 namespace scope for this request</p>
</blockquote>

<p>For example you can install <a href="https://github.com/helm/charts/tree/master/stable/traefik" rel="nofollow noreferrer">traefik chart</a> in namespace tla.</p>

<pre><code>helm install stable/traefik --namespace=tla
NAME:   oily-beetle
LAST DEPLOYED: Tue Mar 24 07:33:03 2020
NAMESPACE: tla
STATUS: DEPLOYED
</code></pre>

<hr>

<p>Another idea which came to my mind is you might want tiller not to use cluster-admin credentials, then this <a href="https://medium.com/@elijudah/configuring-minimal-rbac-permissions-for-helm-and-tiller-e7d792511d10" rel="nofollow noreferrer">link</a> could help. </p>
