In Helm 3, you push and pull charts using an OCI-compliant registry. An OCI registry stores and manages charts and can be hosted on a local file system, a web server, or in cloud storage. The process for pushing and pulling charts in Helm versions earlier than 3.7 differs from that of the helm-push plug-in. This topic describes how to use commands to push and pull charts in these earlier versions.
Step 1: Configure an 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 .
On the Namespace page, click Create Namespace.
In the Create Namespace pane, enter a Namespace name, specify whether to enable Automatically Create Repository, and then click Confirm.
Create an image repository.
On the management page of the Enterprise Edition instance, choose .
On the Repositories page, click Create Repository.
In the Repository Info step, set Namespace, Repository Name, Repository Type, Image Version, Accelerated Image, Summary, and Description, and then click Next.
In the Code Source step, set Code Source, Build Settings, and Build Rules, and then click Create Repository.
Parameter
Description
Code source
Select a code source.
Build settings
Automatically Build Images When Code Changes: Triggers a build rule when code is committed to a branch.
Build with servers deployed outside the Chinese mainland: The build is performed in a data center outside the Chinese mainland. After the build is successful, the image is pushed to the specified region. If your project's Dockerfile needs to download files from sites outside the Chinese mainland and the cross-border network is unstable, you can use Build With Servers Deployed Outside Chinese Mainland.
Build without cache: Forces the system to pull base dependency images again for every image build, which may increase build time. Disable Build Without Cache to accelerate image builds.
On the Repositories page, click the target image repository. If Build appears in the left-side navigation pane of the image repository management page, the image repository is bound to the source code repository.
Configure an access credential.
Set a permanent or temporary password as the access credential for the image repository. The following steps describe how to set a permanent password.
On the management page of the Enterprise Edition instance, choose .
On the Access Credential page, click Set Password.
In the Set Password dialog box, enter the Password and Confirm Password, and click Confirm.
Configure access control.
Enable internet access or add a specified VPC to enable private network access for image uploads. This topic describes how to configure access control over the internet. For more information about how to configure access control for a VPC, see Configure access control for a VPC.
On the management page of the Enterprise Edition instance, choose .
On the Access Control page, click the Internet tab.
On the Internet tab, enable Enable Access over Internet and click Add Internet Whitelist.
In the Add Internet Whitelist dialog box, enter the allowed address block and a description, and then click Confirm.
Turn on the Pull from Anonymous Users switch. (Optional)
After you enable Pull from Anonymous Users, you can pull images from a public image repository 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.
On the Overview page, find the Instance Settings section on the right side and turn on the Pull from Anonymous Users switch.
In the Tips dialog box, click Confirm.
Step 2: Push and pull a chart
Download the required Helm client from the official website.
NoteMake sure that you use a Helm v3 client. You can run the
helm3 version -ccommand to check the client version. The following sections provide examples for v3.0.2.Run the following command to enable the experimental OCI feature for the Helm 3 client.
export HELM_EXPERIMENTAL_OCI=1Run the following command to log on to the Enterprise Edition instance.
Use your Alibaba Cloud account name as the username.
NoteIf you want to push and pull charts from a public image repository, you can go to the Overview page in the Container Registry console and enable Pull from Anonymous Users. Then, you can pull charts from the public image repository without logging on.
helm3 registry login --username=<your_username> <instance_name>.<region>.cr.aliyuncs.comExample:
helm3 registry login --username=123@188077086902**** m**-registry.cn-hangzhou.cr.aliyuncs.comWhen prompted, enter the permanent password that you configured.
Run the following command to create a helloworld chart.
helm3 create helloworldPush and pull the chart.
Push the chart to the image repository.
Run the following command to save the chart directory as a specific tag in the image repository of the Enterprise Edition instance.
helm3 chart save helloworld <instance_name>.<region>.cr.aliyuncs.com/<namespace>/<repository_name>:<tag>Example:
helm3 chart save helloworld m**-registry.cn-hangzhou.cr.aliyuncs.com/m**/test:latestRun the following command to push the chart with the specified tag to the image repository of the Enterprise Edition instance.
helm3 chart push <instance_name>.<region>.cr.aliyuncs.com/<namespace>/<repository_name>:<tag>Example:
helm3 chart push m**-registry.cn-hangzhou.cr.aliyuncs.com/m**/test:latest
Pull the chart from the image repository.
Run the following command to pull the chart with the specified tag from the image repository of the Enterprise Edition instance.
helm3 chart pull <instance_name>.<region>.cr.aliyuncs.com/<namespace>/<repository_name>:<tag>Example:
helm3 chart pull m**-registry.cn-hangzhou.cr.aliyuncs.com/m**/test:latestRun the following command to export the chart to a local directory.
helm3 chart export <instance_name>.<region>.cr.aliyuncs.com/<namespace>/<repository_name>:<tag> -d .Example:
helm3 chart export m**-registry.cn-hangzhou.cr.aliyuncs.com/m**/test:latest -d .Run the following command to install the helloworld chart.
helm install helloworld ./helloworld