Skip to content

Commit 4f212de

Browse files
authored
Merge pull request #174870 from dlepow/acrhelm3
[ACR] Update for Helm 3.7.1
2 parents 259fcb4 + fbb12a8 commit 4f212de

File tree

1 file changed

+43
-79
lines changed

1 file changed

+43
-79
lines changed

articles/container-registry/container-registry-helm-repos.md

Lines changed: 43 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Store Helm charts
33
description: Learn how to store Helm charts for your Kubernetes applications using repositories in Azure Container Registry
44
ms.topic: article
5-
ms.date: 07/19/2021
5+
ms.date: 10/20/2021
66
---
77

88
# Push and pull Helm charts to an Azure container registry
@@ -11,6 +11,9 @@ To quickly manage and deploy applications for Kubernetes, you can use the [open-
1111

1212
This article shows you how to host Helm charts repositories in an Azure container registry, using Helm 3 commands and storing charts as [OCI artifacts](container-registry-image-formats.md#oci-artifacts). In many scenarios, you would build and upload your own charts for the applications you develop. For more information on how to build your own Helm charts, see the [Chart Template Developer's Guide][develop-helm-charts]. You can also store an existing Helm chart from another Helm repo.
1313

14+
> [!IMPORTANT]
15+
> This article has been updated with Helm 3 commands as of version **3.7.1**. Helm 3.7.1 includes changes to Helm CLI commands and OCI support introduced in earlier versions of Helm 3.
16+
1417
## Helm 3 or Helm 2?
1518

1619
To store, manage, and install Helm charts, you use commands in the Helm CLI. Major Helm releases include Helm 3 and Helm 2. For details on the version differences, see the [version FAQ](https://helm.sh/docs/faq/).
@@ -20,8 +23,8 @@ Helm 3 should be used to host Helm charts in Azure Container Registry. With Helm
2023
* Can store and manage Helm charts in repositories in an Azure container registry
2124
* Store Helm charts in your registry as [OCI artifacts](container-registry-image-formats.md#oci-artifacts). Azure Container Registry provides GA support for OCI artifacts, including Helm charts.
2225
* Authenticate with your registry using the `helm registry login` or `az acr login` command.
23-
* Use `helm chart` commands to push, pull, and manage Helm charts in a registry
24-
* Use `helm install` to install charts to a Kubernetes cluster from a local repository cache.
26+
* Use `helm` commands to push, pull, and manage Helm charts in a registry
27+
* Use `helm install` to install charts to a Kubernetes cluster from the registry.
2528

2629
### Feature support
2730

@@ -58,7 +61,7 @@ If you've previously stored and deployed charts using Helm 2 and Azure Container
5861
The following resources are needed for the scenario in this article:
5962

6063
- **An Azure container registry** in your Azure subscription. If needed, create a registry using the [Azure portal](container-registry-get-started-portal.md) or the [Azure CLI](container-registry-get-started-azure-cli.md).
61-
- **Helm client version 3.1.0 or later** - Run `helm version` to find your current version. For more information on how to install and upgrade Helm, see [Installing Helm][helm-install].
64+
- **Helm client version 3.7.1 or later** - Run `helm version` to find your current version. For more information on how to install and upgrade Helm, see [Installing Helm][helm-install]. If you upgrade from an earlier version of Helm 3, review the [release notes](https://github.com/helm/helm/releases).
6265
- **A Kubernetes cluster** where you will install a Helm chart. If needed, create an [Azure Kubernetes Service cluster][aks-quickstart].
6366
- **Azure CLI version 2.0.71 or later** - Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
6467

@@ -109,24 +112,21 @@ EOF
109112

110113
For more about creating and running this example, see [Getting Started](https://helm.sh/docs/chart_template_guide/getting_started/) in the Helm Docs.
111114

112-
## Save chart to local registry cache
115+
## Save chart to local archive
113116

114-
Change directory to the `hello-world` subdirectory. Then, run `helm chart save` to save a copy of the chart locally and also create an alias with the fully qualified name of the registry (all lowercase) and the target repository and tag.
117+
Change directory to the `hello-world` subdirectory. Then, run `helm package` to save the chart to a local archive.
115118

116-
In the following example, the registry name is *mycontainerregistry*, the target repo is *helm/hello-world*, and the target chart tag is *0.1.0*. To successfully pull dependencies, the target chart image name and tag must match the name and version in `Chart.yaml`.
119+
In the following example, the chart is saved with the name and version in `Chart.yaml`.
117120

118121
```console
119122
cd ..
120-
helm chart save . hello-world:0.1.0
121-
helm chart save . mycontainerregistry.azurecr.io/helm/hello-world:0.1.0
123+
helm package .
122124
```
123125

124-
Run `helm chart list` to confirm you saved the charts in the local registry cache. Output is similar to:
126+
Output is similar to:
125127

126-
```console
127-
REF NAME VERSION DIGEST SIZE CREATED
128-
hello-world:0.1.0 hello-world 0.1.0 5899db0 3.2 KiB 2 minutes
129-
mycontainerregistry.azurecr.io/helm/hello-world:0.1.0 hello-world 0.1.0 5899db0 3.2 KiB 2 minutes
128+
```output
129+
Successfully packaged chart and saved it to: /my/path/hello-world-0.1.0.tgz
130130
```
131131

132132
## Authenticate with the registry
@@ -144,23 +144,19 @@ echo $spPassword | helm registry login mycontainerregistry.azurecr.io \
144144
> [!TIP]
145145
> You can also login to the registry with your [individual Azure AD identity](container-registry-authentication.md?tabs=azure-cli#individual-login-with-azure-ad) to push and pull Helm charts.
146146
147-
## Push chart to registry
147+
## Push chart to registry as OCI artifact
148148

149-
Run the `helm chart push` command in the Helm 3 CLI to push the chart to the fully qualified target repository:
149+
Run the `helm push` command in the Helm 3 CLI to push the chart archive to the fully qualified target repository. In the following example, the target repository namespace is `helm/hello-world`, and the chart is tagged `0.1.0`:
150150

151151
```console
152-
helm chart push mycontainerregistry.azurecr.io/helm/hello-world:0.1.0
152+
helm push hello-world-0.1.0.tgz oci://mycontainerregistry.azurecr.io/helm
153153
```
154154

155155
After a successful push, output is similar to:
156156

157157
```output
158-
The push refers to repository [mycontainerregistry.azurecr.io/helm/hello-world]
159-
ref: mycontainerregistry.azurecr.io/helm/hello-world:0.1.0
160-
digest: 5899db028dcf96aeaabdadfa5899db025899db025899db025899db025899db02
161-
size: 3.2 KiB
162-
name: hello-world
163-
version: 0.1.0
158+
Pushed: mycontainerregistry.azurecr.io/helm/hello-world:0.1.0
159+
digest: sha256:5899db028dcf96aeaabdadfa5899db025899db025899db025899db025899db02
164160
```
165161

166162
## List charts in the repository
@@ -185,9 +181,9 @@ Output is similar to:
185181
"readEnabled": true,
186182
"writeEnabled": true
187183
},
188-
"createdTime": "2020-03-20T18:11:37.6701689Z",
184+
"createdTime": "2021-10-05T12:11:37.6701689Z",
189185
"imageName": "helm/hello-world",
190-
"lastUpdateTime": "2020-03-20T18:11:37.7637082Z",
186+
"lastUpdateTime": "2021-10-05T12:11:37.7637082Z",
191187
"manifestCount": 1,
192188
"registry": "mycontainerregistry.azurecr.io",
193189
"tagCount": 1
@@ -209,70 +205,29 @@ Output, abbreviated in this example, shows a `configMediaType` of `application/v
209205
{
210206
[...]
211207
"configMediaType": "application/vnd.cncf.helm.config.v1+json",
212-
"createdTime": "2020-03-20T18:11:37.7167893Z",
208+
"createdTime": "2021-10-05T12:11:37.7167893Z",
213209
"digest": "sha256:0c03b71c225c3ddff53660258ea16ca7412b53b1f6811bf769d8c85a1f0663ee",
214210
"imageSize": 3301,
215-
"lastUpdateTime": "2020-03-20T18:11:37.7167893Z",
211+
"lastUpdateTime": "2021-10-05T12:11:37.7167893Z",
216212
"mediaType": "application/vnd.oci.image.manifest.v1+json",
217213
"tags": [
218214
"0.1.0"
219215
]
220216
```
221217

222-
## Pull chart to local cache
223-
224-
To install a Helm chart to Kubernetes, the chart must be in the local cache. In this example, first run `helm chart remove` to remove the existing local chart named `mycontainerregistry.azurecr.io/helm/hello-world:0.1.0`:
225-
226-
```console
227-
helm chart remove mycontainerregistry.azurecr.io/helm/hello-world:0.1.0
228-
```
229-
230-
Run `helm chart pull` to download the chart from the Azure container registry to your local cache:
231-
232-
```console
233-
helm chart pull mycontainerregistry.azurecr.io/helm/hello-world:0.1.0
234-
```
235-
236-
## Export Helm chart
237-
238-
To work further with the chart, export it to a local directory using `helm chart export`. For example, export the chart you pulled to the `install` directory:
239-
240-
```console
241-
helm chart export mycontainerregistry.azurecr.io/helm/hello-world:0.1.0 \
242-
--destination ./install
243-
```
244-
245-
To view information for the exported chart in the repo, run the `helm show chart` command in the directory where you exported the chart.
246-
247-
```console
248-
cd install
249-
helm show chart hello-world
250-
```
251-
252-
Helm returns detailed information about the latest version of your chart, as shown in the following sample output:
253-
254-
```output
255-
apiVersion: v2
256-
appVersion: 1.16.0
257-
description: A Helm chart for Kubernetes
258-
name: hello-world
259-
type: application
260-
version: 0.1.0
261-
```
262-
263218
## Install Helm chart
264219

265-
Run `helm install` to install the Helm chart you pulled to the local cache and exported. Specify a release name such as *myhelmtest*, or pass the `--generate-name` parameter. For example:
220+
Run `helm install` to install the Helm chart you pushed to the registry. The chart tag is passed using the `--version` parameter. Specify a release name such as *myhelmtest*, or pass the `--generate-name` parameter. For example:
266221

267222
```console
268-
helm install myhelmtest ./hello-world
223+
helm install myhelmtest oci://mycontainerregistry.azurecr.io/helm/hello-world --version 0.1.0
269224
```
270225

271226
Output after successful chart installation is similar to:
272227

273228
```console
274229
NAME: myhelmtest
275-
LAST DEPLOYED: Fri Mar 20 14:14:42 2020
230+
LAST DEPLOYED: Tue Oct 4 16:59:51 2021
276231
NAMESPACE: default
277232
STATUS: deployed
278233
REVISION: 1
@@ -293,6 +248,14 @@ Run `helm uninstall` to uninstall the chart release on your cluster:
293248
helm uninstall myhelmtest
294249
```
295250

251+
## Pull chart to local archive
252+
253+
You can optionally pull a chart from the container registry to a local archive using `helm pull`. The chart tag is passed using the `--version` parameter. If a local archive exists at the current path, this command overwrites it.
254+
255+
```console
256+
helm pull oci://mycontainerregistry.azurecr.io/helm/hello-world --version 0.1.0
257+
```
258+
296259
## Delete chart from the registry
297260

298261
To delete a chart from the container registry, use the [az acr repository delete][az-acr-repository-delete] command. Run the following command and confirm the operation when prompted:
@@ -340,28 +303,29 @@ myregistry/wordpress 9.0.3 5.3.2 Web publishing p
340303
[...]
341304
```
342305

343-
### Save charts as OCI artifacts
306+
### Pull chart archives locally
344307

345-
For each chart in the repo, pull the chart locally, and save it as an OCI artifact. Example:
308+
For each chart in the repo, pull the chart archive locally, and take note of the filename:
346309

347310
```console
348-
helm pull myregisry/ingress-nginx --untar
349-
cd ingress-nginx
350-
helm chart save . myregistry.azurecr.io/ingress-nginx:3.20.1
311+
helm pull myregisry/ingress-nginx
312+
ls *.tgz
351313
```
352314

353-
### Push charts to registry
315+
A local chart archive such as `ingress-nginx-3.20.1.tgz` is created.
316+
317+
### Push charts as OCI artifacts to registry
354318

355319
Login to the registry:
356320

357321
```azurecli
358322
az acr login --name myregistry
359323
```
360324

361-
Push each chart to the registry:
325+
Push each chart archive to the registry. Example:
362326

363327
```console
364-
helm chart push myregistry.azurecr.io/ingress-nginx:3.20.1
328+
helm push ingress-nginx-3.20.1.tgz oci://myregistry.azurecr.io/helm
365329
```
366330

367331
After pushing a chart, confirm it is stored in the registry:

0 commit comments

Comments
 (0)