This message was deleted.
# kubernetes
s
This message was deleted.
a
here is the code I’m using:
Copy code
# Install "metrics-server"
for env in BUILD_ENVIRONMENTS:
    with open(path.join(FILE_DIR, "metrics_values.yaml")) as fin:
        metrics_values = yaml.load(fin)

    k8s.helm.v3.Chart(
        f"metrics-server",
        k8s.helm.v3.ChartOpts(
            chart="metrics-server",
            repo="bitnami",
            fetch_opts=k8s.helm.v3.FetchOpts(
                repo="<https://charts.bitnami.com/bitnami>",
                version="5.8.6",
            ),
            values=metrics_values,
            resource_prefix=env,
        ),
        opts=pulumi.ResourceOptions(
            provider=k8s_providers[env],
            depends_on=eks_node_groups[env],
        ),
    )
l
resource_prefix
is for the k8s resources the Helm chart creates
The URN is Pulumi identifier built from the name you provide Pulumi
k8s.helm.v3.Chart
resource, which is
metrics-server
in this case
Try adding a unique suffix like
f"metrics-server-{env}"
a
thanks for the tip @lemon-monkey-228, although I’ve tried that one as well and it led to the same error (see the screen shot below)
l
oh, is it trying to track each resource created by Helm?
a
I guess so. Isn’t that what we want Pulumi to do? 🤷
l
I’ve mostly been using Pulumi for deploying Kubernetes resources/Helm charts without state tracking so far
In environments where I can just nuke it and redeploy
a
It’s interesting that the pulumi resource name is specified as “metrics-server-{env}“, but the URN is just specified as “…metrics.k8s.io”. Where does this come from 🤔
In environments where I can just nuke it and redeploy
Yeah, if I were only building one environment at a time, then this would work. But the issue is specifically something I’ve run into when trying to manage multiple environment stages in one project 🙈
I think this may be a bug, actually. Apparently the ApiService is optionally created by the helm chart (as in, it’s not something implicitly created by Pulumi) which means it shouldn’t be any different from the other resources created by the Chart. But nevertheless Pulumi doesn’t understand it as something which should have it’s URN updated against the
resource_prefix
input 🤔
l
Why not use 1 project with multiple stacks?
One per environment
a
In this case Im trying to put them all into one stack because all of my k8s clusters are all apart of one “product”, which itself should have dev/test/prod environments. But, in the end, that might be the way to go 😅
But, generally speaking, I think Pulumi should nevertheless be able to manage multiple k8s clusters in a single project/stack. And up until encountering this issue, it can!
l
makes sense if youre deploying them as a single unit
maybe file a bug report
w
any news about this issue?