<@UBAJ7TD53> question regarding k8s helm integrati...
# general
g
@creamy-potato-29402 question regarding k8s helm integration: When I specify
namespace
on a chart via pulumi it seems this only populates the
Release.Namespace
template variable, whereas when running
helm install --namespace <namespace>
tiller seems to actively add an
metadata.namespace
entry before applying the templates to the cluster. Many charts unfortunately don’t have the
Release.Namespace
variable but instead rely on the aforementioned tiller override. Would it be possible to add a similar behaviour to the pulumi helm integration? I think that would greatly decrease confusion for users. I can probably for now manually apply the desired namespace by using
transformations
but I think it would be better UX if pulumi helm behaves a little more like
helm install
instead of
helm template
. Related github issue https://github.com/pulumi/pulumi-kubernetes/issues/200
b
agree here. I guess you could append this to the default transformations here? https://github.com/pulumi/pulumi-kubernetes/blob/master/pack/nodejs/helm.ts#L97
👍 1
g
exactly.
here’s the transformation that works for me:
Copy code
transformations: [
    manifest => {
      manifest.metadata.namespace = namespace;
    }
  ]
created a dedicated github issue for this: https://github.com/pulumi/pulumi-kubernetes/issues/217
c
@glamorous-printer-66548 @billowy-army-68599 my understanding is that this is not true. I could be wrong-- not a helm expert. Will take a look.
g
not a helm expert either, but my understanding is that
helm install
does that transformation whereas
helm template
does not. Since I assume most users are used to using
helm install
I would prefer staying closer to `helm install`’s behaviour if possible.
c
Ah
That could well be true
Probably what's happening there is it's using client go's deploy to name space feature
We could do that here but it will take some plumbing.
g
yeah probably
c
This is much easier than re name spacing everything.
g
i see
c
Because not everything is namespaced
g
ah true, forgot about clusterroles etc. ..
c
That is to say rewriting namespaces is hard in general
Right.
So, doable.
g
Anyways you should either use go-clients deploy to namespace feature or explicitly document this limitation in pulumi’s helm integration. I’m sure I’m not the first or last person to stumble upon this gotcha 🙂 . I actually browsed a few helm charts to see how often that Namespace attribute is templated and it’s surprisingly often not, so a lot of helm charts will see that behaviour.
c
100% agree
We will do this
👍 2