kubernetes / autoscaler

Autoscaling components for Kubernetes
Apache License 2.0
7.95k stars 3.93k forks source link

Publish helm charts also as an OCI package #7086

Open BWagenerGenerali opened 1 month ago

BWagenerGenerali commented 1 month ago

Copied from https://github.com/aws/eks-charts/issues/1070

Which component are you using?:

  1. cluster-autoscaler

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

The helm charts are published using the classic approach with a static webserver and an index.yaml

Describe the solution you'd like:

However in helm 3.8+ the OCI method went GA:

https://blog.bitnami.com/2023/04/httpsblog.bitnami.com202304bitnami-helm-charts-now-oci.html?m=1
https://helm.sh/docs/topics/registries/
https://github.com/helm/helm/releases/tag/v3.8.0

I see two options to use as an OCI mirror:

If you would fully rely on native Github actions to produce these artifacts, the change would be super simple

  - name: Run chart-releaser
    uses: helm/chart-releaser-action@v1.6.0
    env:
      CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
      CR_GENERATE_RELEASE_NOTES: true

    # ================
    # below this line is relevant for OCI publishing
    # ================

  - name: Login to GitHub Container Registry
    uses: docker/login-action@v3
    with:
      registry: ghcr.io
      username: ${{ github.actor }}
      password: ${{ secrets.GITHUB_TOKEN }}

  - name: Push charts to GHCR
    run: |
      shopt -s nullglob
      for pkg in .cr-release-packages/*; do
        if [ -z "${pkg:-}" ]; then
          break
        fi
        helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
      done

Source: https://github.com/prometheus-community/helm-charts/blob/4bbd07f308884d44d0edff23ee60da967dc2cd23/.github/workflows/release.yaml#L39C1-L61C15 Also a lot of other CNCF projects are using this approach.

adrianmoisey commented 1 month ago

/area cluster-autoscaler

Shubham82 commented 1 month ago

cc @jlamillan (PTAL!)

/area helm-charts

jlamillan commented 1 month ago

cc @jlamillan (PTAL!)

/area helm-charts

Are you sure you meant to tag me?

Shubham82 commented 1 month ago

cc @jlamillan (PTAL!) /area helm-charts

Are you sure you meant to tag me?

sorry @jlamillan by mistake I tag you.

cc @gjtempleton