Helm Repositories: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(58 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=
* https://artifacthub.io
* [https://helm.sh/docs/glossary/#repository-repo-chart-repository Helm Glossary - Repository]
* [https://helm.sh/docs/glossary/#repository-repo-chart-repository Helm Glossary - Repository]
* [https://helm.sh/docs/topics/chart_repository/ The Chart Repository Guide]
* [https://helm.sh/docs/topics/chart_repository/ The Chart Repository Guide]
Line 9: Line 10:


=Overview=
=Overview=
{{Note|<center>Revised for Helm 3</center>}}
A repository is a place - usually a HTTP server - where [[Helm_Concepts#Chart|charts]] are collected and shared. A [[Helm_Dependencies#Local_Dependencies|local directory]] can be used as Helm repository too, charts can refer to their dependencies using a <code>file://...</code> syntax. The charts are maintained and exposed by repository in an [[Helm_Concepts#Chart_Archive|archived format]]. A repository must expose an [[#index.yaml| index.yaml]] file in its root. This file contains a list of all packages supplied by repository, together with metadata that allows retrieving and verifying those packages.  
A repository is a place - usually a HTTP server - where [[#Chart|charts]] are collected and shared. A local directory can be used as Helm repository too, charts can refer to their dependencies using a file://... syntax. The charts maintained and exposed by repository in an [[Helm_Concepts#Chart_Archive|archived format]]. A repository must expose in its root an [[#index.yaml| index.yaml]] file that contains a list of all packages supplied by repository, together with metadata that allows retrieving and verifying those packages. When Helm is installed, it is pre-configured with a [[#Default_Repository|default repository]]. New repositories an be [[Helm_repo#Add_a_New_Repository|added]]. The list of locally-configured repository can be inspected with [[Helm_repo#List_Repositories_Helm_is_Configured_With|helm repo list]]. Repositories can be searched for charts with [[helm search]]. Because chart repositories change frequently, it is recommended to [[Helm_repo#Update_the_Local_Repository_Cache|update the local cache]]. Using Helm repositories is recommended practice, but they are optional. A Helm chart can be deployed directly from the local filesystem. Charts are stored and exposed in repositories as  [[Helm_Concepts#Chart_Archive|chart archives]] whose name include the chart name and version:


  my-chart-1.2.3.tgz
When Helm is installed, it is pre-configured with a [[#Default_Repository|default repository]]. New repositories can be [[Helm_repo#Add_a_New_Repository|added]]. The list of locally-configured repository can be inspected with [[Helm_repo#List_Repositories_Helm_is_Configured_With|helm repo list]]. Repositories can be searched for charts with [[helm search]]. Because chart repositories change frequently, it is recommended to [[Helm_repo#Update_the_Local_Repository_Cache|update the local cache]].
 
Using Helm repositories is recommended practice, but they are optional. A Helm chart can be deployed directly from the local filesystem.
 
Charts are stored and exposed in repositories as [[Helm_Concepts#Chart_Archive|chart archives]] whose name include the chart name and version:
<syntaxhighlight lang='text'>
my-chart-1.2.3.tgz
</syntaxhighlight>


As newer versions are added, the old version stay around, so they can be still looked up when an older version is needed.
As newer versions are added, the old version stay around, so they can be still looked up when an older version is needed.
<font color=darkgray>Should the local repository be called cache?</font>.
Helm 2 came with a built-in package server for developer testing. It seems, however, that the <code>helm serve</code> has been removed in Helm 3.


Helm 2 came with a built-in package server for developer testing. It seems, however, that the <code>helm serve</code> has been removed in Helm 3.
=Repository Management=
==Repository URL==
==Source Repository==
 
==<span id='Managed_Repository'></span>Managed (Locally Added) Repository==
 
<font color=darkgray>
 
Also known as "managed" repository.
 
What is a locally added repository? What it is structure? What it is its function?
 
Managed repositories are useful when authentication information needs to be provided. It is cached.
 
TODO: https://helm.sh/docs/topics/chart_repository/
 
</font>
 
A repository becomes "managed" if it is "locally added" with the [[Helm_repo#Add_a_New_Repository|helm repo add]] command.
 
===Repository Name===
 
===repositories.yaml===
 
/Users/<username>/Library/Preferences/helm/repositories.yaml
 
<syntaxhighlight lang='yaml'>
apiVersion: ""
generated: "0001-01-01T00:00:00Z"
repositories:
- name: bitnami
  url: https://charts.bitnami.com/bitnami
  insecure_skip_tls_verify: false
  username: ""
  password: ""
  caFile: ""
  certFile: ""
  keyFile: ""
- ...
</syntaxhighlight>
 
A new entry is added to this file when '[[Helm_repo#Add_a_New_Repository|helm repo add]]' is invoked.
 
==Unmanaged Repository==
Unmanaged repositories can be used when they don't require authentication. [[Helm_dependency#Dependency_Update|helm dependency update]] command will connect directly to the source repository and pull the dependency every times is invoked. If authentication or certificates are required to access the repository, a [[#Managed_Repository|managed repository]] is required.
 
=Known Repositories=
 
==<tt>https&#58;//charts.helm.sh/stable</tt>==
 
The default repository for stable charts is https://charts.helm.sh/stable.
 
To add the repository locally:
 
<font size=-1>
helm repo add stable https://charts.helm.sh/stable
</font>


=Helm Hub=
To see the charts via command line:
<font size=-1>
helm search repo stable
</font>


The canonical source for Helm chart is the Helm Hub https://hub.helm.sh/, an aggregator for distributed chart repositories. Helm Hub exposes [[#stable|stable]] and [[#incubator|incubator]], which reside in GitHub, as well as many other repositories. For more details about "stable" and "incubator", see https://github.com/helm/charts.
To brows the charts, go to the CNCF Artifact Hub and search the "helm-stable" repository:  


==stable==
{{External|https://artifacthub.io/packages/search}}


==Helm Hub==
<font color=darkkhaki>
The canonical source for Helm chart is the Helm Hub https://hub.helm.sh/, an aggregator for distributed chart repositories. Helm Hub exposes [[#stable|stable]] and [[#incubator|incubator]], which both reside in GitHub under https://github.com/helm/charts, as well as many other repositories. Helm Hub is convenient while searching various repositories for charts.
</font>
===stable===
<font color=darkkhaki>
Helm Hub link: https://hub.helm.sh/charts/stable


[[Helm_Dependencies#Dependency_Declaration|Chart.yaml dependencies]] "repository":
<syntaxhighlight lang='yaml'>
dependencies:
  - name: ...
    repository: https://kubernetes-charts.storage.googleapis.com
</syntaxhighlight>


The source resides in GitHub: https://github.com/helm/charts/tree/master/stable, and can be referred in charts as https://hub.helm.sh/charts/stable.
GitHub source: https://github.com/helm/charts/tree/master/stable


More details: https://github.com/helm/charts.
More details: https://github.com/helm/charts.
</font>
===incubator===
<font color=darkkhaki>
Helm Hub link: https://hub.helm.sh/charts/incubator


==incubator==
[[Helm_Dependencies#Dependency_Declaration|Chart.yaml dependencies]] "repository":
<syntaxhighlight lang='yaml'>
dependencies:
  - name: ...
    repository: https://kubernetes-charts-incubator.storage.googleapis.com/
</syntaxhighlight>


The source resides in GitHub: https://github.com/helm/charts/tree/master/incubator, and can be referred in charts as https://hub.helm.sh/charts/incubator
GitHub source: https://github.com/helm/charts/tree/master/incubator
 
More details: https://github.com/helm/charts.
</font>


=Repository Name=
=Repository Name=
Line 40: Line 133:
=Repository URL=
=Repository URL=


The repository URL represents the endpoint of a Helm repository - the endpoint's root must contain an index.yaml file. Also see the discussion for the special case of dependency charts that [[Helm_Chart_requirements.yaml#repository|exist on the local file system]].
The repository URL represents the endpoint of a Helm repository - the endpoint's root must contain an index.yaml file. Also see the discussion for the special case of dependency charts that [[Helm_Dependencies#repository|exist on the local file system]].


=Default Repository=
=Default Repository=
Line 54: Line 147:
=Chart Reference=
=Chart Reference=


A chart stored in a chart repository can be identified by its '''chart reference''', relative to the repository. The chart reference and the [[#Chart_Name|chart name]] are semantically equivalent. The chart reference, or the [[#Chart_Name|chart name]], is used to specify the chart [[Helm_install#Chart_Reference|when installed]].
A chart stored in a chart repository can be identified by its '''chart reference''', relative to the repository. The chart reference and the [[Helm_Concepts#Chart_Name|chart name]] are semantically equivalent. The chart reference, or the chart name, is used to specify the chart [[Helm_install#Chart_Reference|when installed]].


=Repository Structure=
=Repository Structure=
Line 113: Line 206:
=Repository Operations=
=Repository Operations=


* [[helm repo]]
* [[Helm_repo#List_Repositories_Helm_is_Configured_With|Listing locally configured repositories]]
* [[Helm_repo#Remove_a_Locally_Configured_Repository|Removing locally configured repositories]]
* [[helm search]]
* [[helm search]]
* [[Setting Up a Helm Repository in Kubernetes]]
* [[Setting Up a Helm Repository in Kubernetes]]
* [[Helm_search#List_All_Charts_in_the_Repository|List all charts in the repository]]

Latest revision as of 02:35, 10 January 2023

External

Internal

Overview

A repository is a place - usually a HTTP server - where charts are collected and shared. A local directory can be used as Helm repository too, charts can refer to their dependencies using a file://... syntax. The charts are maintained and exposed by repository in an archived format. A repository must expose an index.yaml file in its root. This file contains a list of all packages supplied by repository, together with metadata that allows retrieving and verifying those packages.

When Helm is installed, it is pre-configured with a default repository. New repositories can be added. The list of locally-configured repository can be inspected with helm repo list. Repositories can be searched for charts with helm search. Because chart repositories change frequently, it is recommended to update the local cache.

Using Helm repositories is recommended practice, but they are optional. A Helm chart can be deployed directly from the local filesystem.

Charts are stored and exposed in repositories as chart archives whose name include the chart name and version:

my-chart-1.2.3.tgz

As newer versions are added, the old version stay around, so they can be still looked up when an older version is needed. Should the local repository be called cache?. Helm 2 came with a built-in package server for developer testing. It seems, however, that the helm serve has been removed in Helm 3.

Repository Management

Repository URL

Source Repository

Managed (Locally Added) Repository

Also known as "managed" repository.

What is a locally added repository? What it is structure? What it is its function?

Managed repositories are useful when authentication information needs to be provided. It is cached.

TODO: https://helm.sh/docs/topics/chart_repository/

A repository becomes "managed" if it is "locally added" with the helm repo add command.

Repository Name

repositories.yaml

/Users/<username>/Library/Preferences/helm/repositories.yaml

apiVersion: ""
generated: "0001-01-01T00:00:00Z"
repositories:
- name: bitnami
  url: https://charts.bitnami.com/bitnami
  insecure_skip_tls_verify: false
  username: ""
  password: ""
  caFile: ""
  certFile: ""
  keyFile: ""
- ...

A new entry is added to this file when 'helm repo add' is invoked.

Unmanaged Repository

Unmanaged repositories can be used when they don't require authentication. helm dependency update command will connect directly to the source repository and pull the dependency every times is invoked. If authentication or certificates are required to access the repository, a managed repository is required.

Known Repositories

https://charts.helm.sh/stable

The default repository for stable charts is https://charts.helm.sh/stable.

To add the repository locally:

helm repo add stable https://charts.helm.sh/stable

To see the charts via command line:

helm search repo stable

To brows the charts, go to the CNCF Artifact Hub and search the "helm-stable" repository:

https://artifacthub.io/packages/search

Helm Hub

The canonical source for Helm chart is the Helm Hub https://hub.helm.sh/, an aggregator for distributed chart repositories. Helm Hub exposes stable and incubator, which both reside in GitHub under https://github.com/helm/charts, as well as many other repositories. Helm Hub is convenient while searching various repositories for charts.

stable

Helm Hub link: https://hub.helm.sh/charts/stable

Chart.yaml dependencies "repository":

dependencies:
  - name: ...
    repository: https://kubernetes-charts.storage.googleapis.com

GitHub source: https://github.com/helm/charts/tree/master/stable

More details: https://github.com/helm/charts.

incubator

Helm Hub link: https://hub.helm.sh/charts/incubator

Chart.yaml dependencies "repository":

dependencies:
  - name: ...
    repository: https://kubernetes-charts-incubator.storage.googleapis.com/

GitHub source: https://github.com/helm/charts/tree/master/incubator

More details: https://github.com/helm/charts.

Repository Name

Each locally-added repository is known under a name, which is associated with the repository URL.

Repository URL

The repository URL represents the endpoint of a Helm repository - the endpoint's root must contain an index.yaml file. Also see the discussion for the special case of dependency charts that exist on the local file system.

Default Repository

When Helm is installed, it is pre-configured to look into the official Helm Charts GitHub repository, named "stable". Is this still true for Helm 3?

Local Cache

In Helm 2, the local repository cache is maintained under ~/.helm/repository.

TODO investigate ~/.helm/repository

Chart Reference

A chart stored in a chart repository can be identified by its chart reference, relative to the repository. The chart reference and the chart name are semantically equivalent. The chart reference, or the chart name, is used to specify the chart when installed.

Repository Structure

charts/
 |
 +- index.yaml
 |
 +- blue-1.0.0.tgz
 +- blue-1.0.1.tgz
 +- blue-1.0.2.tgz

index.yaml

https://helm.sh/docs/topics/chart_repository/#the-index-file

The index file contains metadata about hosted charts, including the content of Chart.yaml, and it. is generated by helm repo index.

Example if an index file:

apiVersion: v1
entries:
  a:
  - apiVersion: v2
    created: "2019-12-15T14:01:02.326198-08:00"
    dependencies:
    - name: b
      repository: http://localhost/charts
      version: 1.0.0
    digest: 64627fcd102f2ac9271bfb36e38d57ba3e9c4636fb42fbff582e83d999e7ab3f
    name: a
    urls:
    - a-1.0.0.tgz
    version: 1.0.0
  b:
  - apiVersion: v2
    created: "2019-12-15T14:01:02.326484-08:00"
    dependencies:
    - name: c
      repository: http://localhost/charts
      version: 1.0.0
    digest: 064e1d3507270014718f9fc4539f1ce0c12585bc94d95c82fe5966e25e08582b
    name: b
    urls:
    - b-1.0.0.tgz
    version: 1.0.0
  c:
  - apiVersion: v2
    created: "2019-12-15T14:01:02.32662-08:00"
    digest: a5fbc1d4d9a73c0f16d8c769c8118101f63bde617d46d636c14fb99059bcd96a
    name: c
    urls:
    - c-1.0.0.tgz
    version: 1.0.0
generated: "2019-12-15T14:01:02.324043-08:00"

Runtimes

Repository Operations