How to Use Helm Repo: Add, Update, and Manage Helm Repositories
Use
helm repo add to add a Helm chart repository, helm repo update to refresh the repository list, and helm repo list to see all added repositories. These commands help you manage where Helm looks for charts to install or upgrade.Syntax
The helm repo command manages Helm chart repositories. Key subcommands include:
helm repo add [NAME] [URL]: Adds a new chart repository with a name and URL.helm repo update: Updates all repositories to get the latest charts.helm repo list: Lists all added repositories with their URLs.helm repo remove [NAME]: Removes a repository by name.
bash
helm repo add myrepo https://example.com/charts
helm repo update
helm repo list
helm repo remove myrepoExample
This example shows how to add the official stable Helm chart repository, update it, and list all repositories.
bash
helm repo add stable https://charts.helm.sh/stable
helm repo update
helm repo listOutput
NAME URL
stable https://charts.helm.sh/stable
Common Pitfalls
Common mistakes when using helm repo include:
- Using an incorrect or unreachable URL when adding a repo causes errors.
- Forgetting to run
helm repo updateafter adding a repo means Helm won't see the latest charts. - Trying to install charts from a repo that was not added or removed.
Always verify the repo URL and update repos before installing charts.
bash
helm repo add myrepo https://wrong-url.com/charts # This will fail because the URL is invalid helm repo add myrepo https://charts.helm.sh/stable helm repo update helm install myapp myrepo/nginx
Quick Reference
| Command | Description |
|---|---|
| helm repo add [NAME] [URL] | Add a new Helm chart repository |
| helm repo update | Update all repositories to fetch latest charts |
| helm repo list | List all added repositories |
| helm repo remove [NAME] | Remove a repository by name |
Key Takeaways
Use
helm repo add to add chart repositories by name and URL.Run
helm repo update to refresh repository data before installing charts.Check your repositories anytime with
helm repo list.Ensure repository URLs are correct to avoid errors.
Remove unused repos with
helm repo remove to keep your setup clean.