Install the P2P acceleration agent in your on-premises or third-party cloud clusters to accelerate image pulls and reduce application deployment time.
Prerequisites
-
You have created a Container Registry (ACR) Enterprise Edition instance that is a Advanced Edition. For more information, see Create an Enterprise instance.
-
You have configured a VPC for your Container Registry (ACR) Enterprise Edition instance. For more information, see Configure a VPC ACL.
-
You have connected your on-premises or third-party cloud cluster to the VPC of the Container Registry (ACR) Enterprise Edition instance over Express Connect.
-
You have the following tools installed in your environment:
Step 1: 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 commands in CloudShell to upgrade the P2P module.WarningAfter the upgrade, previous client versions are no longer supported. Before you upgrade, you must stop using the P2P acceleration feature and uninstall the P2P acceleration agent from all clusters where it is installed.
aliyun cr UpdateInstanceModule --region <your-region-id> --InstanceId <your-instance-id> --ModuleName ACCELERATION_P2P --Enable false --force aliyun cr UpdateInstanceModule --region <your-region-id> --InstanceId <your-instance-id> --ModuleName ACCELERATION_P2P --Enable true --force
Step 2: Install the P2P acceleration agent
-
Attach the following policy to the RAM user. Then, create an AccessKey pair and record the AccessKey ID and AccessKey secret.
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "cr:GetInstanceVpcEndpoint", "cr:ListInstanceEndpoint" ], "Resource": "*" } ] } -
Run the following Helm commands to install the P2P acceleration agent.
export ACR_INSTANCE_REGION="<your-acr-instance-region>" export ACR_INSTANCE_ID="<your-acr-instance-id>" export ALIYUN_AK="<your-accesskey-id>" # The AccessKey ID from the previous step. export ALIYUN_SK="<your-accesskey-secret>" # The AccessKey secret from the previous step. 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