Overview
Tencent Container Registry (TCR) can host Helm Charts to meet 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 the console or 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. This means 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.
Prerequisites
Make sure that the following conditions are met before uploading and managing Helm Charts in a TCR Enterprise Edition instance:
Directions
Managing Helm Charts in the console
1. Log in to the TCR console and click Helm Chart in the left sidebar. 2. On the Helm Chart page, view the list of Helm Charts in the current instance. To change the instance, select the required instance name from the Instance Name drop-down list at the top of the page, as shown in the figure below: The Chart list contains the following information and supported operations:
Name: Helm Chart name. You can click it to enter the Chart details page, where you can view and manage each version of the Chart. You can also view the file details of each version of the Chart package on the Basic Information tab.
Namespace: Namespace to which a Helm Chart belongs.
Create Time: Time when the Helm Chart was pushed to the repository for the first time.
3. Click the name of the specified Helm Chart repository to enter the repository details page.
Version Management: This page displays the existing Chart versions in the current repository, and you can download or delete the specified versions, as shown in the figure below: Basic Information: This page displays the Chart version details, such as Chart.yaml, as shown in the figure below: Using the console to upload and download Helm Charts
Uploading a local Helm Chart package
1. Log in to the TCR console and click Helm Chart in the left sidebar.
On the Helm Chart page, you can view the list of Helm Chart repositories in the current instance. To change the instance, select the required instance name from the Instance Name drop-down list at the top of the page. 2. Click Upload. In the Upload Helm Chart pop-up window, configure settings as shown in the figure below: Associated Instance: Current instance selected.
Namespace: Namespace to which the Helm Chart repository belongs. If the list is empty, create a namespace in the instance. Chart Package: Click to select a Helm Chart package that has been downloaded to the local system.
Note
Only Helm Chart packages in .tgz format are supported. Please avoid uploading other types of files. Note that uploading a file will overwrite the existing Chart with the same name.
3. Click Upload to start uploading the Helm Chart package. After uploading, you can view the uploaded Helm Chart on the repository list page. If the uploaded package does not have a corresponding Helm Chart repository, a new repository will be created automatically.
Downloading a Helm Chart package to the local system
1. View the Helm Chart repository list in the current instance on the Helm Chart page. Click the specified repository to enter its version management page.
2. Select the specified version in the Chart repository, click Download on the right of the row where the version is located, and the Chart package on this version will be automatically downloaded to the local system. Depending on the browser and configuration, you can choose to specify the download path.
Using the Helm client to upload and download Helm Charts
Installing a Helm client
Note
Note that, if you wish to use Helm in Tencent Kubernetes Engine (TKE), you need to select a v3.x.x version. You can run the helm version -c
command to check the version of the installed client.
This document takes the installation on a Linux node as an example. For installation on other operating systems, download the corresponding installation package.
Run the following commands in sequence to download and install the Helm client. For more information, see Installing Helm. curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
Adding a Helm repository
1. Log in to the TCR console and go to the Instance list page. On this page, click the name of the target instance to go to the details page. 3. Run the following command on the node to 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/$namespace --username $username --password $instance-token
$instance-$namespace
: Name of the Helm repository. We recommend that you use the combination of instance name + namespace name for naming so as to distinguish between instances and namespaces.
https://$instance.tencentcloudcr.com/chartrepo/$namespace
: Remote address of the Helm repository.
$username
: Username obtained in Step 2.$instance-token
: Password obtained in Step 2.
If the add operation is successful, the following message will be prompted."$instance-$namespace" has been added to your repositories
Pushing Helm Charts
1. Install the helm-push plugin.
Note
Install the helm-push plugin of the v0.10.0 or a later version. Otherwise, version incompatibility may cause Helm Chart package pushing to fail. If the version of the helm-push plugin you use is earlier than v0.10.0, replace helm cm-push
with the helm push
command. To upload Chart packages by using the Helm CLI, you need to install the helm-push plugin. The plugin supports using the helm push
command to push Helm Charts to the specified repository, as well as uploading directories and compressed packages.
helm plugin install https://github.com/chartmuseum/helm-push
2. Run the following command on the node to create a Chart:
helm create tcr-chart-demo
3. (Optional) Run the following command to directly push the specified directory to the Chart repository:
helm cm-push tcr-chart-demo $instance-$namespace
Here, $instance-$namespace
is the name of the added local repository.
4. Run the following commands to compress the specified directory and push it to the Chart repository:
tar zcvf tcr-chart-demo-1.0.0.tgz tcr-chart-demo/
helm cm-push tcr-chart-demo-1.0.0.tgz $instance-$namespace
Here, $instance-$namespace
is the name of the added local repository.
Pulling Helm Charts
1. Run the following command on the node to obtain the latest Chart information:
2. Run the following command to pull the Helm Chart of the 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 TCR Enterprise Edition instance:
helm fetch tcr-demo-project-a/tcr-chart-demo --version 1.0.0
문제 해결에 도움이 되었나요?