-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helmv4: Authentication issue when pulling helm charts from private OCI registries. #3193
Comments
I believe it is a known limitation that Helm OCI support relies on ambient credentials, as set by |
Strictly speaking I don't think we would need to wait for the fix upstream, we could probably plumb the credentials through with what we already have. Related #2911 |
Is it any walk around for this issue @blampe @EronWright? I'm stuck with installation of AWS Gateway AIP Controller chart as it is located only in OCI repository. |
@stepan-romankov the AWS registry is public and doesn't need credentials. chart: "oci://public.ecr.aws/aws-application-networking-k8s/aws-gateway-controller-chart" |
gatewayApiController, err := helmv4.NewChart(ctx, "gateway-api-controller", &helmv4.ChartArgs{
Name: pulumi.String("gateway-api-controller"),
Chart: pulumi.String("oci://public.ecr.aws/aws-application-networking-k8s/aws-gateway-controller-chart"),
Version: pulumi.String("v1.0.7"),
Namespace: namespace.Metadata.Name(),
Values: pulumi.Map{
"region": pulumi.String(region.Name),
"clusterVpcId": eksCluster.Core.VpcId(),
"serviceAccount": pulumi.Map{
"create": pulumi.Bool(false),
},
"log": pulumi.Map{
"level": pulumi.String("debug"),
},
},
}, pulumi.Provider(kubernetesProvider)) |
@stepan-romankov thanks for including your code. It works successfully for me:
As previously mentioned, Pulumi is currently use your ambient helm credentials. This means if you previously logged into |
What happened?
helmv4
allows to download helm charts from private OCI registries by specifying username and password:However, this results in authentication errors despite correct credentials. Different kinds for the different cloud provider registries:
on AWS using ECR
error: an unhandled error occurred: waiting for RPCs: rpc error: code = Unknown desc = unable to locate the chart: pull access denied, repository does not exist or may require authorization: authorization failed: no basic auth credentials
on GCP using GCR
error: an unhandled error occurred: waiting for RPCs: rpc error: code = Unknown desc = unable to locate the chart: unexpected status from HEAD request to https://gcr.io/v2/gke-shared-dev/upstream/helm.cilium.io/tetragon/mainfests/1.1.2: 401 Unauthorized
We did some investigation and the following turns out to be the culprit:
When reproducing the issue with the CLI then this works:
but this doesn’t, even though it should:
The Pulumi helm v4 provider does the equivalent to the latter.
This is recognized as an open upstream helm issue: helm/helm#12769
The main issue is the inconsistency.
helm pull
with username and password without previoushelm registry login
works forhttps://
helm registries, but not foroci://
.If this is an upstream helm issue, why is this posted on the pulumi-kubernetes repo?
The main reason I'm posting this here is that the
helmv4
Pulumi provider copy/pastes some private upstream functions. For instance thenewRegistryClient()
function that the upstream helm bugfix PR is attempting to fix here by adding the username and password to the signature, is copy/pasted into this repo because it's a private function:pulumi-kubernetes/provider/pkg/helm/tool.go
Line 341 in f5f368d
This means that even if the upstream helm PR is merged, the
helmv4
Pulumi provider would still suffer from this issue. So it has to be fixed here as well. But we might still need to wait for the upstream fix, for the new upstreamNewClient()
function.The upstream helm PR has been open for 7 months with most recent activity 1 month ago. We could help push it along.
Output of
pulumi about
╰─ pulumi about CLI Version 3.124.0 Go Version go1.22.5 Go Compiler gc Host OS darwin Version 14.6.1 Arch arm64 Backend Name pulumi.com URL https://app.pulumi.com/jonny-langefeld User jonny-langefeld Organizations jonny-langefeld, snowflake Token type personal
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: