Skip to content
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

Publish helm charts also as an OCI package (e.g. on GHCR/ECR registry) #1070

Open
mkilchhofer opened this issue Feb 28, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@mkilchhofer
Copy link

mkilchhofer commented Feb 28, 2024

Is your feature request related to a problem?
No

Is your feature request related to a specific Helm chart, if yes mention name of the chart?
All helm charts

Describe the solution you'd like
The helm charts are published using the classic approach with a static webserver and an index.yaml (GitHub pages):

helm repo add eks https://aws.github.io/eks-charts

However in helm 3.8+ the OCI method went GA:

I see two options to use as an OCI mirror:

  • GHCR (Github packages)
    You need to think about the Github organizational plan. (Free plan only includes 500MB)
  • AWS ECR (where you mostly push your container images)

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.

Describe alternatives you've considered
Still using the old approach with the index.yaml and static website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant