Tencent Container Registry (TCR) can host Helm charts to meet users' requirements for hosting and distribution of cloud native applications. You can manage both container images and Helm charts in the same namespace so that cloud native deliverables of both container images and Helm charts can be used in a business project.
Currently, only TCR Enterprise Edition instances support Helm chart hosting and the use of a Helm client to upload and download Helm charts. Helm chart repositories inherit the public or private attribute from their namespaces, and no extra configuration is needed. In terms of permission management, Helm charts and container images share the repository resource type. That is, the resource description
qcs::tcr:$region:$account:repository/tcr-xxxxxx/project-a/* contains all image repositories and Helm charts in the "project-a" namespace. You can flexibly use these image repositories and Helm charts during resource permission management.
Before uploading and managing Helm charts in a TCR Enterprise Edition instance, complete the following tasks:
Download the specified Helm client from the official Helm project and install it.
Note that, if you wish to use Helm in Tencent Kubernetes Engine (TKE), you need to select the v2.10.0 version. You can run the
helm version -c command to check the version of the installed client.
# The Linux platform is selected by default. If you install the client on other platforms, download the installation package corresponding to this platform. # Decompress the installation package. tar -zxvf helm-v2.10.0-linux-amd64.tgz # Move the installation package to the specified location. mv linux-amd64/helm /usr/local/bin/helm
Install the Helm plugin.
You need to install Git and the Helm-Push plugin before using the Helm client to upload charts.
# Install the Helm plugin. helm plugin install https://github.com/chartmuseum/helm-push
Obtain the access credentials for the current instance. The access credential is the username plus the temporary password, which is consistent with the credential used for Docker login.
Add the namespace, which is used to manage Helm charts, to the local Helm repository.
helm repo add $instance-$namespace https://$instance.tencentcloudcr.com/chartrepo/$namesapce --username $username --password $instance-token
"$instance-$namespace" is the name of the Helm repository. We recommend that you name this Helm repository using the following format to differentiate instances and namespaces: instance name + namespace name.
https://$instance.tencentcloudcr.com/chartrepo/$namespace is the remote address of the Helm repository, where "$instance" and "$namespace" must be replaced by the actual instance name and namespace name. "$username" and "$instance-token" are the username and temporary password obtained in Step 1.
After the namespace is added, the following prompt is displayed:
"$instance-$namespace" has been added to your repositories
The installed Helm-Push plug-in can use the
helm push command to push Helm charts to a specified repository. Both directories and compressed packages can be uploaded.
In the following example, tcr-chart-demo 1.0.0 is uploaded to the repository added in the previous step.
# Create a local chart. helm create tcr-chart-demo # Push the chart directory, where "$instance-$namespace" is the name of the added local repository. helm push tcr-chart-demo $instance-$namespace # Push the chart package, where "$instance-$namespace" is the name of the added local repository. helm push tcr-chart-demo-1.0.0.tgz $instance-$namespace
# Pull Helm charts of a specified version. helm fetch <Local repository name>/<Chart name> --version <Chart version>
In the following example, tcr-chart-demo 1.0.0 in the "project-a" namespace is pulled from the "tcr-demo" Enterprise Edition instance.
helm fetch tcr-demo-project-a/tcr-chart-demo --version 1.0.0