aws / aws-node-termination-handler

Gracefully handle EC2 instance shutdown within Kubernetes
https://aws.amazon.com/ec2
Apache License 2.0
1.63k stars 265 forks source link

Helm Repo via OCI not completely working? #1070

Closed diranged closed 2 weeks ago

diranged commented 2 weeks ago

Describe the bug It seems like the repository for this helm chart has moved from the eks-charts repo at https://aws.github.io/eks-charts to a new OCI repo documented as oci://public.ecr.aws/aws-ec2/helm/aws-node-termination-handler. The instructions in https://github.com/aws/aws-node-termination-handler/tree/main/config/helm/aws-node-termination-handler do work on the CLI.. ie:

% helm template oci://public.ecr.aws/aws-ec2/helm/aws-node-termination-handler --version 0.24.1 | head -10 
Pulled: public.ecr.aws/aws-ec2/helm/aws-node-termination-handler:0.24.1
Digest: sha256:eb45d96adf2ba8d5d040af52d5fab6b83922c2dcf37cdba2f7562df8c741cf0e
---
# Source: aws-node-termination-handler/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: release-name-aws-node-termination-handler
  namespace: istio-system
  labels:
    app.kubernetes.io/name: aws-node-termination-handler
    app.kubernetes.io/instance: release-name

However, when you try to use the chart as a Helm Dependency via a Chart.yaml like this:

apiVersion: v2
description: aws-node-termination-handler
name: aws-node-termination-handler
version: 0.0.1     # unused, ignored
dependencies:
- name: aws-node-termination-handler
  version: 0.24.0
  repository: oci://public.ecr.aws/aws-ec2/helm/aws-node-termination-handler

You get the following error when you run helm dependency build

% helm dependency build  . 
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading aws-node-termination-handler from repo oci://public.ecr.aws/aws-ec2/helm/aws-node-termination-handler
Save error occurred:  could not download oci://public.ecr.aws/aws-ec2/helm/aws-node-termination-handler/aws-node-termination-handler: public.ecr.aws/aws-ec2/helm/aws-node-termination-handler/aws-node-termination-handler:0.24.0: not found
Error: could not download oci://public.ecr.aws/aws-ec2/helm/aws-node-termination-handler/aws-node-termination-handler: public.ecr.aws/aws-ec2/helm/aws-node-termination-handler/aws-node-termination-handler:0.24.0: not found

I don't have this problem with other public.ecr.aws hosted charts... is there some kind of bug? I did verify that the versions seem to exist when I use curl:

% curl -i -H "Authorization: Bearer $TOKEN" https://public.ecr.aws/v2/aws-ec2/helm/aws-node-termination-handler/tags/list
HTTP/2 200 
date: Mon, 16 Sep 2024 23:50:55 GMT
content-type: text/plain; charset=utf-8
content-length: 97
docker-distribution-api-version: registry/2.0

{"name":"aws-ec2/helm/aws-node-termination-handler","tags":["0.22.0","0.24.0","0.24.1","0.23.0"]}
Lu-David commented 2 weeks ago

Hi @diranged thanks for bringing up this issue. I tried running with this Chart.yaml with this repo: oci://public.ecr.aws/aws-ec2/helm and it worked for me so I think you are using the wrong repo name.

apiVersion: v2
description: aws-node-termination-handler
name: aws-node-termination-handler
version: 0.0.1     # unused, ignored
dependencies:
- name: aws-node-termination-handler
  version: 0.24.0
  repository: oci://public.ecr.aws/aws-ec2/helm

Let me know if you're able to resolve this issue. Thanks!

diranged commented 2 weeks ago

Ugh - indeed you are right. My mistake! Thank you!