aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.21k stars 321 forks source link

[ECR] [Missing ECR Index for helm charts]: Please provide index.yaml for ecr-public repositories #1603

Open filipvh-sentia opened 2 years ago

filipvh-sentia commented 2 years ago

Community Note

Tell us about your request The ECR gallery ( or public repo ) is missing an index file ( index.yaml ). Because of this certain tools ( the terraform helm provider in my case ) won't install the chart as it's not 100% compatible with public helm chart repositories.

Example from the bitnami helm repository:

Repository: https://charts.bitnami.com/bitnami Index file: https://charts.bitnami.com/bitnami/index.yaml

Which service(s) is this request for? ECR

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I'm building and pushing helm charts to an ECR-Public repository on AWS. I'm trying to install these helm charts through the terraform helm provider.

This does not work due to a missing index file ( see additional context ).

Directly running the helm commands works.

Are you currently working around this issue? Yes. I can work around it using a null_resource, but I'd rather not in the long run. Alternatively I could try hosting it on a different public helm repository which generates the index.yaml file.

Additional context The error message is the following:

Error: looks like "https://public.ecr.aws/foo/bar" is not a valid chart repository or cannot be reached: failed to fetch https://public.ecr.aws/foo/bar/index.yaml : 401 Unauthorized

Sample code in terraform:

resource "helm_release" "foobar" {
  repository = "https://public.ecr.aws/foo/bar"
  chart      = "foo-bar"
  namespace  = "foo"

  name       = "foo-bar"
  version    = "1.0.0"
}

Attachments If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)

techcto commented 2 years ago

I am being blocked by this now, so I can work on it - unless there is a work-around. I am using the eks quickstart lambda + a public ecr repo for helm. Please provide more info on where to fix this. Per what I see, we just need to dynamically create this file based on the uploaded chart.

filipvh-sentia commented 2 years ago

That does seem to be the case.

You can generate index.yaml by using a helm command: helm repo index

It'd have to be executed on AWS side after pushing so you'd need the "helm" executable there... Building it yourself is also an option, though I wonder how maintainable that would be in the long run. The file is pretty straightforward though.

The docs have the following example:

apiVersion: v1
entries:
  alpine:
    - created: 2016-10-06T16:23:20.499814565-06:00
      description: Deploy a basic Alpine Linux pod
      digest: 99c76e403d752c84ead610644d4b1c2f2b453a74b921f422b9dcb8a7c8b559cd
      home: https://helm.sh/helm
      name: alpine
      sources:
      - https://github.com/helm/helm
      urls:
      - https://technosophos.github.io/tscharts/alpine-0.2.0.tgz
      version: 0.2.0
    - created: 2016-10-06T16:23:20.499543808-06:00
      description: Deploy a basic Alpine Linux pod
      digest: 515c58e5f79d8b2913a10cb400ebb6fa9c77fe813287afbacf1a0b897cd78727
      home: https://helm.sh/helm
      name: alpine
      sources:
      - https://github.com/helm/helm
      urls:
      - https://technosophos.github.io/tscharts/alpine-0.1.0.tgz
      version: 0.1.0
  nginx:
    - created: 2016-10-06T16:23:20.499543808-06:00
      description: Create a basic nginx HTTP server
      digest: aaff4545f79d8b2913a10cb400ebb6fa9c77fe813287afbacf1a0b897cdffffff
      home: https://helm.sh/helm
      name: nginx
      sources:
      - https://github.com/helm/charts
      urls:
      - https://technosophos.github.io/tscharts/nginx-1.1.0.tgz
      version: 1.1.0
generated: 2016-10-06T16:23:20.499029981-06:00

I think amazon ECR only accepts 1 helm chart per repository ( correct me if I'm wrong ) so the "entries" tab would only have 1 entry ( with multiple versions ).

morariu commented 2 years ago

How do we add the index.yaml to the respective chart in ECR? Or is there a workaround? Thanks

artemptushkin commented 1 year ago

I think it's not really needed, I see two ways to pull/use a chart from ECR:

  1. helm pull, here is my example
  2. helm install

However, helm repo add is not working with OCI protocol

kannansasientrust commented 1 year ago

any plans to fix this? while push/pull works, it'll be really convenient to make other commands like "helm repo list/add" also work.

techcto commented 4 months ago

Wow -- I asked for this on Jan 2022 (see above) -- took some time off of EKS and need this still. My pipelines really need this to be done. Extra code is needed to just do a normal helm install.

+1 Just let us push the index.yaml to the ecr like we can with s3

aws s3 cp index.yaml s3://please-add-this/charts/index.yaml