Working with Chart Repositories
1. Adding Chart Repository
Example: Add popular repos
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
| Flag | Purpose |
|---|---|
--username / --password | Basic auth for private repo |
--ca-file | Custom CA bundle |
--cert-file / --key-file | mTLS client cert |
--pass-credentials | Forward credentials to redirected URL |
--force-update | Replace existing repo entry |
2. Listing Repositories
| Command | Output |
|---|---|
helm repo list | Table of name + URL |
helm repo list -o json | JSON for scripting |
helm repo list -o yaml | YAML output |
3. Updating Repository Index
| Command | Purpose |
|---|---|
helm repo update | Refresh index.yaml for all repos |
helm repo update bitnami | Refresh single repo only |
helm repo update --fail-on-repo-update-fail | Exit non-zero on any failure (CI) |
4. Removing Repository
| Command | Effect |
|---|---|
helm repo remove <name> | Deletes entry from repositories.yaml + cache |
helm repo remove a b c | Removes multiple repos |
5. Searching Repository Charts
Example: Find a chart
helm search repo nginx
helm search repo nginx --versions # all versions
helm search repo nginx --version "^1.0" # version constraint
helm search repo bitnami/ # all charts in repo
6. Viewing Repository Index
| Command | Result |
|---|---|
cat ~/.cache/helm/repository/bitnami-index.yaml | Raw cached index |
curl -s https://charts.bitnami.com/bitnami/index.yaml | Live index from server |
helm search repo bitnami/ -o yaml | Parsed view of charts |
7. Using Private Repositories
Example: HTTPS basic auth
helm repo add internal https://charts.corp.example.com \
--username "$CHARTS_USER" --password "$CHARTS_PASS"
helm repo update internal
helm install api internal/api-service
8. Configuring Repository Credentials
| Mechanism | Usage |
|---|---|
| Basic auth | --username / --password on repo add |
| mTLS | --cert-file, --key-file, --ca-file |
| Env vars (CI) | Inject secrets, never commit repositories.yaml with passwords |
| OCI | helm registry login writes to ~/.config/helm/registry/config.json |
Warning:
repositories.yaml stores passwords in plain text. Use OCI + Docker creds helpers or external secret tooling for CI.9. Setting Repository Cache
| Setting | Value |
|---|---|
| Cache root | $HELM_CACHE_HOME (default OS cache dir) |
| Per-repo index | $HELM_CACHE_HOME/repository/<name>-index.yaml |
| Downloaded charts | $HELM_CACHE_HOME/repository/<name>-<version>.tgz |
| Clear cache | rm -rf $HELM_CACHE_HOME/repository && helm repo update |
10. Managing Multiple Repositories
Example: Scripted CI bootstrap
declare -A repos=(
[bitnami]=https://charts.bitnami.com/bitnami
[prom]=https://prometheus-community.github.io/helm-charts
[grafana]=https://grafana.github.io/helm-charts
)
for name in "${!repos[@]}"; do
helm repo add "$name" "${repos[$name]}" --force-update
done
helm repo update
| Pattern | Why |
|---|---|
| Pin repo URLs in Git | Reproducible builds across teams |
Use --force-update | Idempotent re-runs in pipelines |
| Prefer OCI over HTTP | Auth via existing registry credentials |