helm repo add: Usage, Options & Common CI Errors
Register a chart repo so you can install from it.
helm repo add records a named chart repository in the local Helm config so you can search and install its charts. In CI you add the repos a build needs before installing third-party charts.
What it does
helm repo add NAME URL fetches the repo's index.yaml and stores the entry. --username / --password (or --pass-credentials) authenticate to private repos; --force-update overwrites an existing entry with the same name - important in CI where a cached config may already hold a stale URL. After adding, helm repo update refreshes the cached index.
Common usage
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add internal https://charts.example.com \
--username "$HELM_USER" --password "$HELM_PASS"
helm repo add bitnami https://charts.bitnami.com/bitnami --force-update
helm repo update bitnamiCommon errors in CI
"Error: looks like \"URL\" is not a valid chart repository or cannot be reached" means the URL does not serve an index.yaml - a wrong URL, a repo that is OCI-only (use oci:// with helm pull/install, not repo add), or a network/proxy block. "401 Unauthorized" on a private repo means missing or wrong credentials; pass --username/--password and, for some servers, --pass-credentials so creds follow redirects. In CI the repo config is per-home; a fresh runner has no repos, so add (and update) them every run, and use --force-update to avoid "repository name (X) already exists" on cached homes.
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 nodes