-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support helm authentication for helm chart repositories. #4335
Comments
@ArthurCieslik: This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This is pretty easy to fix, but I have quite a few (newb) questions before I could throw out a PR:
tested diff:
PS It appears as if |
We will be supporting this in our next iteration of the helm generator. |
I am now facing this issue as well. It seems like the helm chart inflator is non-functional after the helm v3 release. Since oci registry support is not functional, I attempted to use a chartmuseum repository instead to hopefully make this tool work using a non-oci protocol. However, I ended up running into this issue. I was unable to add a repo with the saved credentials through In the issue I linked above I proposed a similar change to the one outlined in @snuggie12 's comment. I would love to see these changes get applied as this would eliminate a TON of bash scripting that we currently have around deployment. |
I think this is a bit of a mis-feature, as authentication can be established with repositories prior to kustomize being involved, ala |
It might be a silly question, but in which pod should I do : I see lots of pods like: argocd-repo-server, argocd-server, argocd-redis-ha-server, ... Or can I do helm repo add setting somewhere in yaml file? If so, where it would be? |
You shouldn't have to run this in a pod. You should just need to run it on your local machine where you are running the |
The environment variable for |
Could you supply a working example including versions of kustomize and helm plus all relevant yaml and config files? The problem as I know it is that beginning in 4.x of kustomize the api for a helm chart was reduced and when a "helm pull" is initiated it doesn't have the correct format to pull from a repo that is locally stored and had no capability of providing a username and password to a straight URL. |
|
These fixes update the HelmChartInflation tool so that it works with Helm 3 These changes are related to issues kubernetes-sigs#4381 and kubernetes-sigs#4335 on the kustomize github
Thanks @tis-rpage. However I would also like to request a working example. First of all at my system I don not find the
Thus I converted the yaml into a json but still the |
Don't try to hand create the file contents, use {
"auths": {
"<AWSACCOUNTIDGOESHERE>.dkr.ecr.us-east-1.amazonaws.com": {
"auth": "<BASE64encodedAUTHSTRING>"
},
"<OCIREGISTRY>.example.com": {
"auth": "<BASE64encodedAUTHSTRING>"
}
}
} The
With {
"payload": "<BASE64encodedBINARY>",
"datakey": "<BASE64encodedBINARY>",
"version": "2",
"type": "DATA_KEY",
"expiration": "<INTEGER_OFFSET>"
} |
Sorry, I have been away from work and hadn't gotten a chance to clear this up. @tis-rpage As I said above, it is not about the authentication. It's the format of the
when it should be:
I think what's important is that this is going to get fixed in #4401 and the kep for the registry. @natasha41575 are the features for the new helm plugin specifically tracked? I haven't seen one yet. @QuinnBast thanks for also including my code in your patch and release! I know you were more focused on |
QuinnBast already opened up #4381 specifically to address OCI connections. My comments on this ticket are regarding authentication, which kustomize/helm already support via external authentication passed in via secured files and environment variable references. In general, putting credentials on the command line is poor practice, as it exposes credentials via |
If you pre-seed mkdir -p bases/aws-ack-rds/charts
VER=v0.0.19
helm pull oci://public.ecr.aws/aws-controllers-k8s/rds-chart --version "${VER}"
tar xf "rds-chart-${VER}.tgz" -C bases/aws-ack-rds/charts
rm "rds-chart-${VER}"
<<-EOF cat > bases/aws-ack-rds/kustomization.yaml
helmCharts:
- namespace: ack
name: rds-chart
repo: oci://public.ecr.aws/aws-controllers-k8s/rds-chart
version: v0.0.19
releaseName: ee
includeCRDs: true
EOF
kustomize build --enable-helm bases/aws-ack-rds
|
I think "pre-seed" is where the disconnect may be. A lot of issues created around the future of helm chart inflation with kustomize are about running it in a gitops environment like argocd. There's no chance to run |
Most workflows allow you to have a |
Hi all, The apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: <CHARTNAME>
version: <some version>
repo: https://<host>/chartrepo/<repo>
valuesFile: values-develop.yaml
namespace: argocd
releaseName: ...
I see that the helm command ran behind the scenes is : HELM_REGISTRY_CONFIG=/.../registry.json helm pull --untar --untardir <some path>/<CHARTNAME>/charts --repo https://<host>/chartrepo/<repo> <CHARTNAME> --version <some version> Instead, in my case I can generate a But then the helm command that would works should not have HELM_POSITORY_CONFIG=/.../repository.yaml helm pull --untar --untardir <some path>/<CHARTNAME>/charts <repository name>/<CHARTNAME> --version <some version> Hence I tried to remove the repository url in the apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: <repository name>/<CHARTNAME>
version: <some version>
repo: null
valuesFile: values-develop.yaml
namespace: argocd
releaseName: ... Alas, I get the following error: $ kustomize build --enable-helm
Error: no repo specified for pull, no chart found at '' Am I missing anything? |
@remidebette Yeah, that is the entire purpose of this issue and this issue. In the linked issue I've created a binary which contains the fix although it is not officially supported. |
/assign |
bump |
@natasha41575 it looks like the code specifically for this is here - https://github.com/kubernetes-sigs/kustomize/blob/master/plugin/builtin/helmchartinflationgenerator/HelmChartInflationGenerator.go#L235-L238 I wish i had more Golang expertise to properly contribute, but is there a way we can make the |
@jmmclean I also released an unofficial patch for this a few months ago |
Would be great to hear some news about this topic and what speaks against the fix @QuinnBast provided? Also what I don't understand how to use/implement the render-helm-chart from krm-functions-registry. I have understood that it is here mentiond as the new home of the "helm-chart generator plugin", but I have no clue how to use it. |
I'm getting the same issue trying to use a private helm repository using Github. helm repo add my-private-repo https://my-corp.github.io/my-private-helm \
--username some-one \
--password $GITHUB_TOKEN \
--pass-credentials
helm pull my-private-repo/my-chart It would be great if kustomization installation/config accepted global credentials to be used in all helm contexts using the flags like |
/triage out-of-scope This will be supported in the new KRM Function implementation, but is out of scope for the current Kustomize built-in: |
@KnVerey: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
reference KRM issue for others tracking #4401 |
Wait, this got closed? That is very disappointing... This makes Kustomize completely unusable to me as we need to use the The Helm long-term plan has had no action in over 2 years so it's sad that such a simple feature as logging in to a helm registry is "out of scope"... The helm chart inflator doesn't even work if run kustomize locally against an already authenticated repository... Works:
But Kustomize Does not work:
|
When using helmCharts in kustomize, helm chart repositories authentication is not supported.
Further, kustomize prevents the helm credentials storage and usage due to the way kustomize is using helm.
Example:
In a case like this:
Kustomize uses to download the chart a helm command like this
Helm supports credentials to chart repositories via parameters or it's own repository management. You can template, install or pull a helm chart via a secured repository either by
or adding a repository to the helm configuration including the repository credentials
Issue:
Kustomize is not supporting the handover of repository credentials, but it is also prevents the usage of helm repository management by making the field 'repo' mandatory.
It is an optional field in the kustomize yaml but in such case the repo parameter is set during the helm command anyway, which prevents helm to look into it's own repository configuration:
Solution:
Make the 'repo' field optional, since the repository can be predefined in a helm configuration and the repository name becomes part of the chartName:
Alternatively introduce an repoName field in the kustomize helmCharts section where repoName becomes part of the helm command:
The text was updated successfully, but these errors were encountered: