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

gray-hamburger-90102

09/09/2021, 10:20 AM
Hey everyone, how can I get the namespace property back from a helm chart deployment? https://www.pulumi.com/docs/reference/pkg/kubernetes/helm/v3/chart/#outputs claims that all input properties are ouputs, but there's no
redis.namespace
property. I want to retrieve it from the helm chart output as I need to ensure the secret retrieval for
redisPassword
happens after the helm chart has deployed.
Copy code
const redis = new k8s.helm.v3.Chart("tyk-redis", {
        fetchOpts:{
            repo: "<https://charts.bitnami.com/bitnami>",
        },
        repo: "bitnami",
        chart: "redis",
        namespace: tykFargateProfile.selectors.apply(selectors => selectors[0].namespace)
    });

    const redisPassword = k8s.core.v1.Secret.get("redisPassword", `${/*namespace here*/}/tyk-redis`).data.apply(data => data["redis-password"]);
s

steep-toddler-94095

09/09/2021, 5:23 PM
maybe something like this will work for you?
Copy code
const namespaceName = tykFargateProfile.selectors.apply(selectors => selectors[0].namespace)
const redis = new k8s.helm.v3.Chart("tyk-redis", {
  fetchOpts:{
      repo: "<https://charts.bitnami.com/bitnami>",
  },
  repo: "bitnami",
  chart: "redis",
  namespace: namespaceName
})
const redisPassword = namespaceName.apply(n=>redis.getResource("v1/Secret", n, "tyk-redis")).data.apply(data => data["redis-password"])
4 Views