https://pulumi.com logo
#general
Title
# general
g

glamorous-printer-66548

09/21/2018, 11:38 PM
@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

billowy-army-68599

09/21/2018, 11:42 PM
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

glamorous-printer-66548

09/21/2018, 11:43 PM
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

creamy-potato-29402

09/22/2018, 12:36 AM
@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

glamorous-printer-66548

09/22/2018, 12:37 AM
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

creamy-potato-29402

09/22/2018, 12:38 AM
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

glamorous-printer-66548

09/22/2018, 12:38 AM
yeah probably
c

creamy-potato-29402

09/22/2018, 12:39 AM
This is much easier than re name spacing everything.
g

glamorous-printer-66548

09/22/2018, 12:39 AM
i see
c

creamy-potato-29402

09/22/2018, 12:40 AM
Because not everything is namespaced
g

glamorous-printer-66548

09/22/2018, 12:40 AM
ah true, forgot about clusterroles etc. ..
c

creamy-potato-29402

09/22/2018, 12:40 AM
That is to say rewriting namespaces is hard in general
Right.
So, doable.
g

glamorous-printer-66548

09/22/2018, 12:42 AM
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

creamy-potato-29402

09/22/2018, 12:56 AM
100% agree
We will do this
👍 2