Store and manage Helm charts as Open Container Initiative (OCI) artifacts in a Container Registry Enterprise Edition instance. OCI artifact support has been stable in Helm since version 3.7.
Prerequisites
Before you begin, ensure you have the following:
Helm 3.7 or later installed. Run
helm versionto checkA Container Registry Enterprise Edition instance
An Alibaba Cloud account with access to the Container Registry console
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, choose Repository > Namespace.
Click Create Namespace.
In the Create Namespace dialog box, set Namespace and Automatically Create Repository, then click Confirm.
Create an image repository
In the left-side navigation pane, choose Repositories > Repositories.
Click Create Repository.
In the Repository Info step, set Namespace, Repository Name, Repository Type, Tags, Accelerated Image, Summary, and Description, then click Next.
In the Code Source step, configure Code Source, Build Settings, and Build Rules, then click Create Repository. To confirm the repository is linked to a source code repository, click the repository on the Repositories page and check whether Build appears in the left-side navigation pane.
Parameter
Description
Code Source
The source code repository to link to this image repository
Automatically Build Images When Code Changes
Triggers a build automatically when code is committed to the linked branch
Build with Servers Deployed Outside Chinese Mainland
Builds images on overseas servers and pushes them to the target region. Enable this when your Dockerfile pulls resources from overseas and the cross-border connection is unstable.
Build Without Cache
Pulls the base image fresh on every build. Disable to speed up builds by reusing cached layers
Configure an access credential
Set a password as the access credential for your Enterprise Edition instance.
In the left-side navigation pane, choose Instances > Access Credentials.
Click Password.
In the Set Password dialog box, enter and confirm your password, then click Confirm.
A temporary token can also be used as the access credential.
Configure access policies
Enable Internet access so that charts can be pushed to and pulled from the instance.
In the left-side navigation pane, choose Repositories > Access Control.
Click the Internet tab.
Turn on Enable Access over Internet, then click Add Internet Whitelist.
In the Add Internet Whitelist dialog box, specify the CIDR block to allow and an optional description, then click Confirm.
To use VPC access instead of Internet access, see Configure a VPC ACL.
(Optional) Enable anonymous pull
Turn on Pull from Anonymous Users to allow anyone to pull charts from public repositories in this instance without logging on.
Log on to the Container Registry console.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances .
Click the Enterprise Edition instance you want to manage.
On the Overview page, in the Instance Settings section, turn on Pull from Anonymous Users.
In the Tips dialog box, click Confirm.
Step 2: Push and pull charts
Enable OCI support
Run the following command to enable OCI artifact support in Helm 3.7:
export HELM_EXPERIMENTAL_OCI=1Log on to the instance
Replace <registry-logon-name> with your Alibaba Cloud account name. Replace <instance-name> and <region-id> with your instance details.
helm3 registry login -u <registry-logon-name> <instance-name>-registry.cn-<region-id>.cr.aliyuncs.comWhen prompted, enter the password you set in the previous step.
Example:
helm3 registry login -u acr_test_***@test.aliyunid.com ***-registry.cn-hangzhou.cr.aliyuncs.comIf Pull from Anonymous Users is enabled on the Overview page, charts in public repositories can be pulled without logging on.
Create and package a chart
Create a sample HelloWorld chart:
helm3 create helloworldPackage the chart directory into a compressed archive:
tar -zcvf test.tgz helloworld
Push a chart
The OCI URI for pushing must end with the namespace, not the repository name. The repository name is read from the chart package itself.
helm3 push test.tgz oci://<instance-name>-registry.cn-<region-id>.cr.aliyuncs.com/<namespace>Example:
helm3 push test.tgz oci://***-registry.cn-hangzhou.cr.aliyuncs.com/testPull and install a chart
The OCI URI for pulling must end with the repository name, followed by --version to specify the image tag.
Pull the chart package:
helm3 pull oci://<instance-name>-registry.cn-<region-id>.cr.aliyuncs.com/<namespace>/<repository-name> --version <image-tag>Example:
helm3 pull oci://***-registry.cn-hangzhou.cr.aliyuncs.com/test/trem --version helloworldDecompress the chart package:
tar -xzvf helloworld-<image-tag>.tgzInstall the chart:
helm install helloworld ./helloworld
What's next
Configure a VPC ACL to restrict instance access to specific VPCs