pulumi-kubernetes icon indicating copy to clipboard operation
pulumi-kubernetes copied to clipboard

Cannot pull helm chart from private ACR repository

Open Hugzy opened this issue 2 years ago • 2 comments

What happened?

I tried to deploy a Helm Chart using the Helm Release resource where the Helm Chart is located in a private repository hosted on azure.

Expected Behavior

That I can pull and deploy my Helm Chart.

Steps to reproduce

  • Have a helm chart in a private repository like ACR

  • Make sure that you are not logged in via the docker CLI, auth should go through pulumi using https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#repositoryopts

  • Deploy the chart.

  • It fails with an unauthorized error.

Output of pulumi about

CLI
Version      3.52.0
Go Version   go1.19.4
Go Compiler  gc

Additional context

I asked about this in the slack channel, where I was recommended to create an issue. I wrote this.

"Hi, I'm trying to deploy a helm chart that I created myself and pushed to ACR using pulumi. When I test locally it worked fine, however when I tried to do this from my build-environment I get the following error. error: failed to pull chart: failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized The weird thing is that it works if I do a docker login to my repository locally and when I logout it doesn't, so it is probably something with regards to the embedded helm CLI that requires authentication and falls back to the environment if it doesn't exist, but I cannot seem to set this correctly. I've tried to use the following https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/#repositoryopts to set a docker username and password, but that didn't seem to work. Relevant config so far looks like this"

            Chart = oci://<ContainerRegistry>/<Chart>,
            RepositoryOpts = new RepositoryOptsArgs()
            {
                Username = <DockerUsername>,
                Password = <DockerPassword>,
            },
            Version = <HelmVersion>

Hugzy avatar Feb 17 '23 09:02 Hugzy