Helm is a package manager for Kubernetes used to package, manage, and deploy applications. After you create or update a chart, you can push it to a Helm repository for others to use.
Step 1: Configure the Enterprise Edition instance
-
Create a namespace.
Log on to the Container Registry console.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
On the management page of the Enterprise Edition instance, choose in the navigation pane on the left.
-
On the Namespace page, click Create Namespace.
-
In the Create Namespace dialog box, enter a Namespace name, specify Automatically Create Repository and Default Configurations for Automatically Created Repositories, and then click Confirm.
-
Create a chart repository.
NoteIf you enable Automatically Create Repository for the namespace, you can skip creating a chart repository in the console and push charts directly from your client.
In an Enterprise Edition instance, a chart repository address uses the format
<instance-name>-chart.<region-id>.cr.aliyuncs.com/<namespace>/<repository-name>. A chart version uses the format<chart-name>-<version-number>. To access the repository over a VPC, the address format is<instance-name>-chart-vpc.<region-id>.cr.aliyuncs.com/<namespace>/<repository-name>.-
On the Overview page of the Enterprise Edition instance, in the Component Settings section, turn on the Charts switch.
-
On the management page of the Enterprise Edition instance, choose in the navigation pane on the left.
-
On the Chart Repository page, click Create Chart Repository.
-
In the Create Helm Chart dialog box, select a Namespace, set the Chart Repository Name and Type, and then click Confirm.
-
-
Configure an access credential.
You can use a fixed password or a temporary token as the access credential for your Helm charts. This example uses a fixed password.
-
On the management page of the Enterprise Edition instance, choose in the navigation pane on the left.
-
On the Access Credentials page, click Set Password.
-
In the Set Password dialog box, enter a Password and a Confirm Password, and then click Confirm.
-
-
Configure an access control policy.
Enable access over the Internet or from a specific VPC to upload Helm charts. This example demonstrates configuring Internet access. For more information about how to configure access control for a VPC, see Configure VPC access control.
-
On the management page of the Enterprise Edition instance, choose in the navigation pane on the left.
-
On the Access Control page, click the Internet tab.
-
On the Internet tab, turn on the Enable Access over Internet switch and click Add Internet Whitelist.
-
In the Add Internet Whitelist dialog box, enter the allowed CIDR blocks and their descriptions, and then click Confirm.
-
-
(Optional) Enable Pull from Anonymous Users.
After you enable Pull from Anonymous Users, you can pull public charts without logging in.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
In the Instance Settings section on the right side of the Overview page, turn on the Pull from Anonymous Users switch.
-
In the Tips dialog box, click Confirm.
Step 2: Install and configure the client
-
Download a Helm version from the official website.
NoteEnsure your Helm client is a v2 release. You can run the
helm version -ccommand to check the client version. These steps use v2.14.2 as an example. -
Run the following commands to decompress the Helm package and move it to a specified directory.
# Decompress the package. tar -zxvf helm-v2.14.2-linux-amd64.tgz # Move the package to a specified directory. mv linux-amd64/helm /usr/local/bin/helm -
Install the Helm plug-in.
NoteYou must install Git before you install the Helm plug-in.
If you are outside the Chinese mainland or have a stable connection to GitHub, run the following command to install the Helm plug-in.
helm plugin install https://github.com/AliyunContainerService/helm-acr -
Initialize the Helm environment.
-
If you are on a node in a Container Service for Kubernetes (ACK) cluster, Tiller is initialized by default, so you only need to initialize the client. To avoid accessing Google chart sources, run the following command:
helm init --client-only --skip-refresh -
On a node in a self-managed Kubernetes cluster, run the following command to avoid accessing Google chart sources:
helm init --skip-refresh
-
Step 3: Push and pull charts
-
Run the following commands to configure a local repository mapping.
You must specify a local repository name and map it to a chart repository in a specific namespace.
export HELM_REPO_USERNAME='<username-of-your-access-credential>'; export HELM_REPO_PASSWORD='<password-of-your-access-credential>'; helm repo add <local-repository-name> acr://<instance-name>-chart.<region-id>.cr.aliyuncs.com/<namespace>/<repository-name> --username ${HELM_REPO_USERNAME} --password ${HELM_REPO_PASSWORD} -
Push a chart.
-
Run the following commands to push a chart.
# Create a chart locally. helm create <chart-name> # Push the chart directory. helm cm-push <chart-name> <local-repository-name> # Or, push a compressed chart package. helm cm-push <chart-name>-<chart-version>.tgz <local-repository-name>xxx# helm create chartname Creating chartname xxx# helm push chartname localChart Pushing chartname-0.1.0.tgz to localChart... Done. xxx#
On the Chart Repository page, click the name of the chart repository, and then click Versions. On the Versions page, you can view the new chart.
-
-
Run the following commands to pull a chart.
# Update the local chart index. helm repo update # Pull the chart. helm fetch <local-repository-name>/<chart-name> --version <chart-version> # Or, install the chart directly. helm install -f values.yaml <local-repository-name>/<chart-name> --version <chart-version>