-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws_eks): HelmChart doesn't support repository pointing to OCI uri #32187
Comments
Yes you are right. I am not super familiar with helm with OCI but from what I've learned from Amazon Q, yes, it should be I guess this should be related in https://github.com/aws/aws-cdk/blob/3e7ba32a79da23096501ee3e78eb6190c908118c/packages/%40aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py My questions: Given
Did you see this from the lambda logs?
How should CDK figure out the OCI URLs from above? From I've learned here, I assume it should just |
This was in the logs:
|
I will validate that later as creating a cluster needs some time but I guess this should work for you. Are you able to have a quick test on this? aws_eks.HelmChart(
self,
"ExternalDnsControllerChart",
cluster=eks_cluster,
repository="oci://registry-1.docker.io/bitnamicharts",
namespace="kube-system",
release="external-dns",
chart="external-dns",
version="8.6.0",
) |
No
But, for some reason it works if you set |
I think you're right:
So this is an helm issue rather than a CDK issue I think. |
Thank you! I think we should have a pytest for our kubectl/helm handler python and list all known use cases/scenarios in the tests. Without that, it would be very difficult to maintain and subject to errors. I will bring it up to the team. From your provided suggested code: aws_eks.HelmChart(
self,
"ExternalDnsControllerChart",
cluster=eks_cluster,
repository="https://charts.bitnami.com/bitnami",
namespace="kube-system",
release="external-dns",
chart="external-dns",
version="8.6.0",
) It seems the helm handler has to figure out the real oci URL from |
Well, you would have to look into the index.yaml, parse it and extract the url, but I don't think this is the way to go. It looks like helm is returning the error when |
Reported upstream |
Good callout. Actually, I was thinking maybe we should introduce a method like
just as how you run I am not a big fan that CDK to maintain a translation layer in between as it's very unintuitive and prompt to error. Generally, when we validate a helm chart, we should first run it via |
OK let me sharing the debugging here. My code: const cluster = new eks.Cluster(this, 'EKSCluster', {
vpc,
version: eks.KubernetesVersion.V1_31,
defaultCapacity: 1,
kubectlLayer: new KubectlV31Layer(this, 'KubectlLayer'),
});
cluster.addHelmChart('ExternalDnsControllerChart', {
repository: 'https://charts.bitnami.com/bitnami',
namespace: 'kube-system',
release: 'external-dns',
chart: 'external-dns',
version: '8.6.0'
}); And I updated the /node_modules/aws-cdk-lib/custom-resource-handlers/dist/aws-eks/kubectl-handler/helm/init.py adding the two lines as below: Now I deploy and I can see this in the cloudwatch logs
Now, let's join this array
'helm upgrade external-dns external-dns --install --create-namespace --repo https://charts.bitnami.com/bitnami --version 8.6.0 --namespace kube-system --kubeconfig /tmp/kubeconfig' So what's happening in Lambda is actually running this helm command rather than
as you mentioned in the original description. Obviously, the CDK helm handler would NOT find out the OCI URI from repo and we need to figure out what is the correct helm command without specifying the OCI URI. Can you share a working |
Yes, my original assumption was wrong. The handler doesn't transform the repository uri and it just passes it to the |
I'm going to close this as I don't think there's anything that needs to happen on the CDK side. |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
I'm trying to deploy the latest external-dns chart using CDK, however, now it moved to OCI, as in the
index.yaml
has a reference to the OCI url:This is causing the helm layer to try to run something like:
It doesn't work because helm doesn't want the tag to be in the URL from what I can see, as this command will work fine:
So in short I believe the lambda layer for helm should check if the URL exposed in the repository index.yaml is in fact an OCI url and remove the tag from it because it causes helm to fail (version can be still specified with
--version
) .Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
It should be possible to deploy an helm chart if the index.yaml is referencing a OCI uri.
Current Behavior
Helm fails with
Error: invalid_reference: invalid tag
because the supplied OCI url contains the tag that Helm doesn't want.Reproduction Steps
Add the following construct to a chart:
Possible Solution
Modify the layer so that checks for the presence of an OCI url and strips the tag from the url.
Additional Information/Context
No response
CDK CLI Version
2.167.0
Framework Version
No response
Node.js Version
All
OS
All
Language
TypeScript, Python, .NET, Java, Go
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: