You can use the P2P acceleration feature in on-premises clusters and clusters in third-party clouds to accelerate image pulling and reduce the time that is used to deploy applications. This topic describes how to install a P2P acceleration kit in an on-premises cluster or a cluster of a third-party cloud.
Prerequisites
An Advanced Edition instance of Container Registry Enterprise Edition is created. For more information, see Create a Container Registry Enterprise Edition instance.
A virtual private cloud (VPC) is configured for the Container Registry Enterprise Edition instance. For more information, see Configure a VPC ACL.
The on-premises cluster or the cluster of a third-party cloud is connected to the Container Registry Enterprise Edition instance over the VPC by using an Express Connect circuit.
The following tools are installed in the environment in which you run the command:
Step 1: Obtain the ID of the Container Registry Enterprise Edition instance and upgrade the P2P module
- 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, click the
icon in the top navigation bar and run the following command on the Cloud Shell module to upgrade the P2P module:
WarningAfter you upgrade the P2P module, you are no longer able to use the Cloud Shell client of old version. Before you upgrade the P2P module, you must stop using the P2P feature and uninstall the P2P component from all clusters that use the P2P component.
aliyun cr UpdateInstanceModule --region <region ID> --InstanceId <istance ID> --ModuleName ACCELERATION_P2P --Enable false --force aliyun cr UpdateInstanceModule --region <region ID> --InstanceId <instance ID> --ModuleName ACCELERATION_P2P --Enable true --force
Step 2: Install the P2P component, including granting corresponding permissions to the P2P component
Create a RAM user. For more information, see Create a RAM user.
Add the following permissions to the RAM user and view the AccessKey pair of the RAM user: For more information, see View the information about AccessKey pairs of a RAM user.
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "cr:GetInstanceVpcEndpoint", "cr:ListInstanceEndpoint" ], "Resource": "*" } ] }
Run the following command to install the P2P component by using Helm:
export ACR_INSTANCE_REGION="<region of acr instance >" export ACR_INSTANCE_ID="<id of acr instance >" export ALIYUN_AK="<aliyun access key>" # The AccessKey ID that you viewed in step 2. export ALIYUN_SK="<aliyun access key secret >" # The AccessKey secret that you viewed in step 2. export P2P_CHART="https://aliacs-k8s-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/app/charts-incubator/ack-acr-acceleration-p2p-0.3.5.tgz" helm install ack-acr-acceleration-p2p $P2P_CHART -n aliyun-acr-acceleration --create-namespace \ --set region=$ACR_INSTANCE_REGION \ --set accessKey=$ALIYUN_AK \ --set accessKeySecret=$ALIYUN_SK \ --set p2p.registryInstances=$ACR_INSTANCE_ID \ --set pullImageInternet=true \ --set p2p.plusMode.enable=true