Helm repo: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(19 intermediate revisions by the same user not shown)
Line 9: Line 9:
=Overview=
=Overview=
{{Note|<center>Revised for Helm 3</center>}}
{{Note|<center>Revised for Helm 3</center>}}
Caching repositories locally is useful when installing charts and specifying the chart to be installed [[Helm_install#Using_a_Repository_Prefix|using the name of the locally cached repository and the name of the chart]]. However, charts can be installed [[Helm_install#Absolute_URL|directly from the remote repository]], without having to add (cache) the repository locally. The repositories are cached locally with [[#Add_a_New_Repository|helm repo add]] command, but the cache is not automatically kept up to date in any way, it has to be explicitly updated with [[#Update_the_Local_Repository_Cache|helm repo update]].


=List Repositories Helm is Configured With=
=List Repositories Helm is Configured With=


helm repo list
<syntaxhighlight lang='bash'>
helm repo list
</syntaxhighlight>
=List All Charts in a Repository=
{{Internal|Helm_search#List_All_Charts_in_the_Repository|List all charts in the repository}}


=Add a New Repository=
=Add a New Repository=
<syntaxhighlight lang='bash'>
helm repo add <repository-name> <repository-url>
</syntaxhighlight>
<syntaxhighlight lang='bash'>
helm repo add dev https://example.com/dev-charts
</syntaxhighlight>


helm repo add dev https://example.com/dev-charts
==Adding a Repository that Requires Authentication==
 
Helm does not allow specifying authentication credentials alongside the [[Helm_Dependencies#repository|repository URL]] in Chart.yaml, so when dependencies need to be pulled from an authenticated repository, an authenticated managed repository must be used. The credentials are specified when the repository is locally added. The credentials are retained in the repository configuration, and they do not have to be specified every time the dependencies are updated with [[Helm_dependency#Dependency_Update|helm dependency update]].
 
<syntaxhighlight lang='bash'>
helm repo add <repository-name> <repository-url> --username <username> --password <password>
</syntaxhighlight>


Note that the repository must expose an index.yaml, otherwise the above command will fail with .../index.yaml 404 Not Found.
Note that the repository must expose an index.yaml, otherwise the above command will fail with .../index.yaml 404 Not Found.


helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
To test that the authentication works:
 
<syntaxhighlight lang='bash'>
helm search repo <repository-name>
</syntaxhighlight>
 
<repository-url> does not work when used with the [[Helm search|helm search]] command.
 
==What Happens when a New Repository is Added==
 
A new entry is added to [[Helm_Repositories#repositories.yaml|repositories.yaml]].


=Update the Local Repository Cache=
=Update the Local Repository Cache=


The command reaches out to remote repositories Helm installation is configured with and updates information about ?
The command reaches out to remote repositories Helm installation is configured with and gets the latest information about charts. Information is cached locally


helm [--debug] repo update
<syntaxhighlight lang='bash'>
helm [--debug] repo update
</syntaxhighlight>


=Find what Versions of a Specific Chart are Available in a Repository=
=Find what Versions of a Specific Chart are Available in a Repository=
Line 32: Line 62:
One method is to download (or look on-line) at the repository index and do a text search.
One method is to download (or look on-line) at the repository index and do a text search.


=Remove a Repository=
=<span id='Remove_a_Repository'></span>Remove a Locally Configured Repository=


helm repo remove local
<syntaxhighlight lang='bash'>
helm repo remove <repository-name>
</syntaxhighlight>


=Generate an Index File=
=Generate an Index File=


helm repo index
<syntaxhighlight lang='bash'>
helm repo index <chart-dir>
</syntaxhighlight>
 
Generates an index from files in the directory specified as argument, which is expected to contain packaged charts.
 
=Add a Chart to a Remote Repository=
 
<syntaxhighlight lang='bash'>
helm repo add my-chart https://some-helm-repository.com
</syntaxhighlight>

Latest revision as of 02:40, 10 January 2023

External

Internal

Overview


Revised for Helm 3


Caching repositories locally is useful when installing charts and specifying the chart to be installed using the name of the locally cached repository and the name of the chart. However, charts can be installed directly from the remote repository, without having to add (cache) the repository locally. The repositories are cached locally with helm repo add command, but the cache is not automatically kept up to date in any way, it has to be explicitly updated with helm repo update.

List Repositories Helm is Configured With

helm repo list

List All Charts in a Repository

List all charts in the repository

Add a New Repository

helm repo add <repository-name> <repository-url>
helm repo add dev https://example.com/dev-charts

Adding a Repository that Requires Authentication

Helm does not allow specifying authentication credentials alongside the repository URL in Chart.yaml, so when dependencies need to be pulled from an authenticated repository, an authenticated managed repository must be used. The credentials are specified when the repository is locally added. The credentials are retained in the repository configuration, and they do not have to be specified every time the dependencies are updated with helm dependency update.

helm repo add <repository-name> <repository-url> --username <username> --password <password>

Note that the repository must expose an index.yaml, otherwise the above command will fail with .../index.yaml 404 Not Found.

To test that the authentication works:

helm search repo <repository-name>

<repository-url> does not work when used with the helm search command.

What Happens when a New Repository is Added

A new entry is added to repositories.yaml.

Update the Local Repository Cache

The command reaches out to remote repositories Helm installation is configured with and gets the latest information about charts. Information is cached locally

helm [--debug] repo update

Find what Versions of a Specific Chart are Available in a Repository

One method is to download (or look on-line) at the repository index and do a text search.

Remove a Locally Configured Repository

helm repo remove <repository-name>

Generate an Index File

helm repo index <chart-dir>

Generates an index from files in the directory specified as argument, which is expected to contain packaged charts.

Add a Chart to a Remote Repository

helm repo add my-chart https://some-helm-repository.com