Publishing Charts to Repository
1. Generating Repository Index
2. Updating Index with New Chart
| Flag | Effect |
|---|---|
--merge ./old-index.yaml | Preserve existing entries (avoids losing old versions) |
Example: Incremental index
helm package ./chart -d ./dist
helm repo index ./dist --url https://charts.acme.io --merge ./dist/index.yaml
3. Setting Base URL
| Flag | Use |
|---|---|
--url | Public download URL prefix for each .tgz |
4. Hosting Static Repository
| Backend | Notes |
|---|---|
| S3 / GCS / Azure Blob | Public bucket + --url |
| Nginx / Apache | Plain HTTPS file server |
| GitHub Pages | Free; via gh-pages branch |
5. Using GitHub Pages
Example: Publish via gh-pages
git checkout gh-pages
helm package ../charts/api -d .
helm repo index . --url https://acme.github.io/charts --merge index.yaml
git add . && git commit -m "release api 1.4.2" && git push
6. Publishing to ChartMuseum
Example: Push via cm-push plugin
helm plugin install https://github.com/chartmuseum/helm-push
helm repo add chartmuseum https://charts.corp.example.com
helm cm-push ./chart chartmuseum
7. Publishing to Harbor
Example: Harbor OCI
helm registry login harbor.acme.io -u $USER -p $PASS
helm package ./chart
helm push chart-1.4.2.tgz oci://harbor.acme.io/charts
8. Publishing to Artifactory
| Method | Command |
|---|---|
| REST API | curl -u user:pass -T chart-1.4.2.tgz https://artifactory/charts/ |
| JFrog CLI | jfrog rt u chart-1.4.2.tgz helm-local/ |
| OCI mode | helm push ... oci://artifactory.acme.io/charts |
9. Automating Repository Updates
Example: Release workflow
name: Release Charts
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: azure/setup-helm@v4
- uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10. Managing Repository Versions
| Practice | Reason |
|---|---|
| Never delete old versions | Breaks reproducibility for pinned deployments |
| Use SemVer + immutable tags | Republishing same version corrupts caches |
| Sign packages | Verify integrity (esp. with mirrored repos) |