helm repo add: Command Reference for CI/CD
Register a chart repository so Helm can pull from it.
helm repo add registers a named chart repository for later install, pull, and dependency resolution. This reference covers the auth and force-update flags and the CI ordering that matters before a dependency build.
Common flags and usage
- repo add <name> <url>: register a repository
- --username / --password: authenticate a private repo
- --force-update: overwrite an existing entry with the same name
- --pass-credentials: send credentials on all domains (use carefully)
- Follow with helm repo update to fetch the latest index
Example
helm repo add bitnami https://charts.bitnami.com/bitnami \
--force-update
helm repo add internal https://charts.example.com \
--username ci --password ${{ secrets.HELM_REPO_TOKEN }} \
--force-update
helm repo updateIn CI
Use --force-update so re-adding a repo on a cached runner does not error on a name clash. Add every repo a chart depends on before helm dependency update or helm dependency build, and pass private-repo credentials from the CI secret store.
Using this in CI
A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods
# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info
# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodesKey takeaways
- --force-update makes repo add idempotent on cached runners.
- Add all required repos before a dependency build.
- Pass private-repo credentials from the CI secret store, not inline.