https://pulumi.com logo
#python
Title
# python
a

alert-monitor-28534

11/26/2019, 9:19 AM
Running `helm install --namespace rook-ceph --name rook-ceph rook-release/rook-ceph`puts
rook-ceph-operator
pod to `rook-ceph`namespace, but this Pulumi code puts it in
default
namespace and it fails there:
Copy code
from pulumi_kubernetes.core.v1 import Namespace
from pulumi_kubernetes.helm.v2 import Chart, ChartOpts

ns = Namespace("rook-ceph", metadata={"name": "rook-ceph"})

Chart("rook-ceph", ChartOpts(
    "rook-release/rook-ceph",
    version="v1.1.7",
    values={"hostpathRequiresPrivileged": True},
    namespace=ns.metadata["name"]))
Is there a bug in Pulumi?
w

white-balloon-205

11/26/2019, 3:29 PM
I suspect this is related to https://github.com/pulumi/pulumi-kubernetes/issues/217#issuecomment-504160101. Can you see if any suggestions there work - and if not leave a note about your scenario?
👍 1
a

alert-monitor-28534

11/27/2019, 6:39 AM
Holy crap, I got it working! Thanks @white-balloon-205! For the other non-programmers who can only work with examples, here's what sent the remaining resources to correct namespace:
Copy code
from pulumi import ResourceOptions
from pulumi_kubernetes.provider import Provider
from pulumi_kubernetes.core.v1 import Namespace
from pulumi_kubernetes.helm.v2 import Chart, ChartOpts

k8sprovider = Provider("rook-ceph", namespace="rook-ceph")
ns = Namespace("rook-ceph", metadata={"name": "rook-ceph"})

Chart("rook-ceph", ChartOpts(
    "rook-release/rook-ceph",
    version="v1.1.7",
    values={"hostpathRequiresPrivileged": True},
    namespace=ns.metadata["name"]),
    ResourceOptions(providers={"provider": k8sprovider}))
👍 2
4 Views