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

damp-book-35965

05/13/2019, 4:50 PM
So I'm trying to move a helm chart provisioned using pulumi to a different namespace, the helm chart includes a cluster role binding and it already exists, this is making pulumi fail with this message:
Copy code
kubernetes:<http://rbac.authorization.k8s.io:ClusterRoleBinding|rbac.authorization.k8s.io:ClusterRoleBinding> (monitoring/kube-state-metrics):
    error: Plan apply failed: <http://clusterrolebindings.rbac.authorization.k8s.io|clusterrolebindings.rbac.authorization.k8s.io> "kube-state-metrics" already exists
Is this a known issue ? If not how do I get over this ? I know I can manually delete the kube-state-metrics binding
g

gorgeous-egg-16927

05/13/2019, 5:04 PM
This is likely related to https://github.com/pulumi/pulumi-kubernetes/issues/520 - we’re currently working on fixes for several related issues. Current workaround would be removing the resource and then recreating in the new namespace.
d

damp-book-35965

05/13/2019, 5:13 PM
Okay thanks. Is it part of the current milestone ?
g

gorgeous-egg-16927

05/13/2019, 5:15 PM
Yes, and fixes are in progress
👍 1
c

cold-coat-35200

05/13/2019, 6:11 PM
If you have a namespace tranformation, that's could be an issue, because ClusterRoleBinding is namespace independent, but when adding namespace to it, pulumi will use that during naming, so changing the namespace, force recreate the resource, we had the same problem, recreated it without the namespace, so next time we won't have this problem and made our transformation code a little bit smarter
d

damp-book-35965

05/13/2019, 11:00 PM
When you say recreated without a namespace, you mean it went into the default or whatever the helm chart put as default for namespace ? @cold-coat-35200
c

cold-coat-35200

05/14/2019, 7:34 AM
Recreated without the metadata.namespace field, so it went to whatever kubernetes put cluster wide resources, but with this change the pulumi does not contained the namespace anymore
d

damp-book-35965

05/14/2019, 3:56 PM
Okay got it