The Helm cm-push plug-in allows you to push and pull charts. Helm uses a packaging format called charts. A chart is a collection of files that describe a related set of Kubernetes resources. Before you use the Helm cm-push plug-in to push charts to a remote chart repository, you must run the helm plugin install
command to install the Helm cm-push plug-in on your on-premises device. Then, you can run the helm push
command to push charts.
If you want to use the Helm cm-push plug-in to push and pull charts over HTTP, you must submit a ticket to add the local IP address of the chart repository to the whitelist.
Step 1: Configure your 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.
In the left-side navigation pane of the management page of the Enterprise Edition instance, choose .
On the Namespace page, click Create Namespace.
In the Create Namespace dialog box, configure the Namespace, Automatically Create Repository, and Default Repository Type parameters, and then click Confirm.
Create a chart repository.
NoteWhen Automatically Create Repository is enabled for the namespace, you can use Helm to push charts to a chart repository without the need to create the chart repository in advance in the Container Registry console.
The chart repository of the Enterprise Edition instance is in the following format:
<Instance name>-chart.<Region ID>.cr.aliyuncs.com/<Namespace>/<Chart repository name>
. The version of the chart repository is<Chart name>-<Version number>
. If you want to access the chart repository over a virtual private cloud (VPC), the chart repository must be in the following format:<Instance name>-chart-vpc.<Region ID>.cr.aliyuncs.com/<Namespace>/<Chart repository name>
.On the Overview page of the Enterprise Edition instance, turn on Charts in the Component Settings section.
In the left-side navigation pane of the management page of the Enterprise Edition instance, choose .
On the Repositories page, click Create Repositories.
In the Create Helm Chart dialog box, configure the Namespace, Repository Name, and Type parameters, and then click Confirm.
Configure an access credential.
Set a password or a temporary token that is used to access Helm charts. In this example, a password is configured as the access credential.
In the left-side navigation pane of the management page of the Enterprise Edition instance, choose .
On the Access Credential page, click Set Password.
In the Set Password dialog box, configure the Password and Confirm Password parameters. Click Confirm.
Configure an access control policy.
Enable Internet access or VPC access to ensure that Helm charts can be pushed to repositories. In this example, Internet access is enabled. For information about how to enable VPC access, see Configure a VPC ACL.
In the left-side navigation pane of the management page of the Enterprise Edition instance, choose Access Control.
On the Access Control page, click the Internet tab.
On the Internet tab, turn on Enable Access over Internet and click Add Internet Whitelist.
In the Add Internet Whitelist dialog box, specify the CIDR blocks that are allowed to access the Enterprise Edition instance and the notes, and then click Confirm.
(Optional) Turn on Pull from Anonymous Users.
After you turn on Pull from Anonymous Users, you can access the public chart repository anonymously without logging on.
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 of the Enterprise Edition instance, turn on Pull from Anonymous Users.
In the Tips dialog box, click OK.
Step 2: Install and configure the Helm client
Download Helm.
NoteYou can use a Helm 3.7 or later client to push and pull charts. You can run the
helm version -c
command to view the versions of helm clients. In this example, Helm 3.10.0 is downloaded to push and pull charts.Run the following command to decompress the Helm installation package and place the Helm installation package in the specified directory:
# Decompress the installation package. tar -zxvf helm-v3.10.0-rc.1-linux-amd64.tar.gz # Move the extracted files to the specified directory. mv linux-amd64/helm /usr/local/bin/helm
Run the following command to install the Helm cm-push plug-in:
NoteBefore you install the Helm cm-push plug-in, run the
yum install git
command to install Git.helm plugin install https://github.com/AliyunContainerService/helm-acr
Step 3: Push and pull charts
Run the following command to specify the name of an on-premises repository and map the repository name to a chart repository in a namespace in Container Registry:
helm repo add <Name of the on-premises repository> https://test9-7-chart****.cn-hangzhou.cr.aliyuncs.com/ns1/repo1 --username <username> --password <password>
Run the following command to push charts:
# Create an on-premises chart. helm create <Chart name> # Push the chart directory. helm cm-push <Chart name> <Name of the on-premises repository>
In the left-side navigation pane of the Container Registry Enterprise Edition instance, choose Helm Chart > Repositories. On the Repositories page, click the name of the chart repository that you want to view and then click Versions. On the Versions page, you can view the new chart that you pushed.
Run the following commands to install and pull charts:
# Update the on-premises chart index from the chart repository in Container Registry. helm repo update # Pull a chart. helm fetch <Name of the on-premises repository>/<Chart name> --version <Chart version> # Directly install a chart. helm install -f values.yaml <Name of the on-premises repository>/<Chart name> --version <Chart version>