The P2P acceleration feature speeds up image pulling across on-premises clusters and third-party cloud clusters, reducing application deployment time. Follow these steps to upgrade the P2P module on your Container Registry (ACR) Enterprise Edition instance and install the P2P acceleration agent in your cluster.
Prerequisites
Before you begin, ensure that you have:
A Container Registry Enterprise Edition instance (Advanced Edition). P2P acceleration is not available for Basic Edition instances. For more information, see Create an Enterprise instance
A virtual private cloud (VPC) configured for the Container Registry Enterprise Edition instance. For more information, see Configure a VPC ACL
The on-premises or third-party cloud cluster connected to the Container Registry Enterprise Edition instance over the VPC through an Express Connect circuit
The following tools installed in your local environment:
Step 1: Upgrade the P2P module on your ACR instance
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 CloudShell icon in the top navigation bar.
In the CloudShell terminal, run the following commands to upgrade the P2P module.
WarningAfter the upgrade, the old version of the client is no longer supported. Before you upgrade, stop using the P2P acceleration feature and uninstall the P2P acceleration agent from all clusters where it is installed.
aliyun cr UpdateInstanceModule --region <region-id> --InstanceId <instance-id> --ModuleName ACCELERATION_P2P --Enable false --force aliyun cr UpdateInstanceModule --region <region-id> --InstanceId <instance-id> --ModuleName ACCELERATION_P2P --Enable true --forceReplace
<region-id>with the region of your ACR instance (for example,cn-hangzhou) and<instance-id>with the ID of your Enterprise Edition instance.
Step 2: Set up permissions
Create a Resource Access Management (RAM) user. For more information, see Create a RAM user.
Add the following custom policy to the RAM user:
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "cr:GetInstanceVpcEndpoint", "cr:ListInstanceEndpoint" ], "Resource": "*" } ] }Create an AccessKey pair for the RAM user and record the AccessKey ID and AccessKey secret. For more information, see Create an AccessKey pair.
Step 3: Install the P2P acceleration agent
Set the following environment variables. Replace the placeholder values with your actual configuration.
export ACR_INSTANCE_REGION="<region-id>" export ACR_INSTANCE_ID="<instance-id>" export ALIYUN_AK="<accesskey-id>" # AccessKey ID from Step 2 export ALIYUN_SK="<accesskey-secret>" # AccessKey secret from 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"Run the following Helm command to install the P2P acceleration agent:
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=trueParameter Description regionRegion of the Container Registry Enterprise Edition instance accessKeyAccessKey ID of the RAM user created in Step 2 accessKeySecretAccessKey secret of the RAM user created in Step 2 p2p.registryInstancesID of the Container Registry Enterprise Edition instance pullImageInternetSet to trueto pull P2P component images from the internetp2p.plusMode.enableSet to trueto enable P2P plus mode for cross-regional, cross-VPC, hybrid cloud, and IDC scenarios