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

enough-kite-69616

05/29/2020, 3:02 PM
How do I create a secret in a namespace other than default in kubernetes? I've tried giving it the name
ns/secretname
like the docs suggest, but it doesn't seem to work
g

green-school-95910

05/29/2020, 3:04 PM
You set the name and namespace of on the
metadata
field
Copy code
const secret = new kubernetes.core.v1.Secret(
  "[NAME_OF_PULUMI_RESOURCE]",
  {
    metadata: {
      name: "[NAME_OF_SECRET_ON_K8S]",
      namespace: "[K8S_NAMESPACE]",
    },
    data: {
    // Secret data...
    },
  },
);
e

enough-kite-69616

05/29/2020, 3:09 PM
Cool, thanks!
c

creamy-potato-29402

05/29/2020, 7:32 PM
btw, pulumi behaves the same as the kubernetes in general here.