This topic introduces how VKE, in combination with Volcano Engine CR, provides P2P acceleration capabilities by utilizing internal node network bandwidth to distribute images between nodes.
P2P acceleration speeds up pulling gigabyte-sized container images in large-scale clusters, supporting concurrent pulls from hundreds to thousands of nodes. Note the following recommendations:
- When you select a P2P cache disk type, we recommend using local disks first. If the region or ECS instance type does not support local disks, prioritize ESSD cloud disks. For performance information about different storage types, see P2P acceleration performance reference.
- We recommend creating a dedicated P2P cache node pool to isolate scheduling and seed caching capabilities from business workloads. This prevents the acceleration add-on and business workloads from competing for resources such as nodes and networks, which may affect normal business operations. For details, see Overview of P2P image acceleration.
tip
For better image acceleration performance, we recommend using the image warm-up feature to pre-warm images on Seed Peer nodes. This allows P2P nodes to cache image data in advance, and you can then gradually expand the scale of image pulls.
When using cloud disks as P2P image cache disks, consider the following factors:
- Cloud disk specifications: The cloud disk type and capacity affect the throughput of an individual disk. For details, see ESSD FlexPL and ESSD PL0.
- Total throughput of a cloud disk cluster: Confirm that the total throughput of the cloud disk cluster in the target region and availability zone meets the expected concurrent image pull requirements.
- Pressure on disks from workloads within the cluster: Avoid excessive read and write load on cloud disks during image pulling, as this may interrupt production workloads in the cluster and even affect other users in the region. If P2P acceleration causes excessive disk pressure, contact VKE support to configure an appropriate speed limit and then restart the p2p-accelerator add-on.
tip
Currently, only CR Standard Edition instances support P2P acceleration.
Step 1: Add cache disks to an existing node pool
Note
The cache disk settings apply only to new nodes added to the node pool later. Cache disks are not automatically attached to existing nodes. To apply the settings to existing nodes, choose one of the following methods:
- Rotate existing nodes: Gradually replace existing nodes with new nodes. Cache disks are automatically attached to new nodes.
- In the left navigation pane, click Cluster. Click the name of the target cluster to go to the management page of this cluster.
- In the left navigation pane, choose Image acceleration to open the image acceleration configuration page.
- On the image acceleration configuration page, select the target node pool, then click Configure cache disk in the Actions column.
- In the pop-up configuration page, add a new P2P cache disk for nodes.
- Click Confirm to finish.
- After configuration is complete, check the configuration of the corresponding node pool. You can see the newly added P2P cache disk mounted to the /mnt/p2pcache directory.
Step 2: (Optional) Create a dedicated cache node pool
- On the image acceleration configuration page, click Create a dedicated cache node pool to go to the managed node pool configuration page.
- The system automatically configures some parameters of the dedicated P2P cache node pool, as shown in the table below. For information about other parameters, see Creating a managed node pool.
- After configuring other required parameters (such as the availability zone, subnet, and login password) and optional parameters, click Confirm to complete the configuration.
Step 3: Configure kubelet and containerd parameters
- On the image acceleration configuration page, select the target node pool and click Configure Kubelet/Containerd parameters in the Actions column.
- On the page that appears, configure the kubelet and containerd parameters for the node pool.
- Click Confirm to finish.
Step 4: Install the P2P acceleration add-on
tip
If the p2p-accelerator add-on is already installed in your cluster, upgrade it to v2.0.0 or later.
- In the add-on installation section of the image acceleration configuration page, click Install.
- On the page that appears, configure and install the p2p-accelerator add-on. For detailed parameter descriptions, see p2p-accelerator.
Confirming configurations
- After the configuration is complete, verify on the image acceleration configuration page that cache disks are configured for the cluster nodes, the dedicated P2P node pool exists, and the p2p-accelerator add-on is installed and running properly.
- View the node details in the cluster. On the Label tab, confirm that the P2P acceleration-related labels are effective.
- For nodes in the dedicated P2P node pool, the label vke.volcengine.com/p2p-cache-enabled=true should exist.
- For new nodes in the existing node pool, the label vke.volcengine.com/p2p-cache-disk=true should exist.
After configuration is complete, create a workload in the cluster to pull images, then use the image acceleration dashboard in cloud-native observability to confirm that the feature works properly.
- Create a workload to trigger an image pull. For this example, a Deployment is created. For details, see Creating a Deployment.
- In the left navigation pane of the cluster management page, click Monitoring center > Dashboard.
- In the left dashboard list, select Image acceleration service monitoring > Image acceleration monitoring to view the P2P image acceleration monitoring dashboard. For details about the dashboard, see Image acceleration observability.
Mounting cache disks to existing nodes
Attaching cache disks to an existing node pool takes effect only for new nodes. For existing nodes, you need to configure this manually. Procedure:
tip
We recommend testing on a single node before performing batch operations.
- In the left navigation pane, click Storage > Volumes, then click Create volume to create a data volume.
- Find the target volume and in the Actions column, click ... > Attach to attach the data volume to the corresponding VKE node. For details, see Attaching volumes.
- After the volume is attached, log in to the VKE node and run the following command to confirm the storage device name on the node.
tip
This topic uses the newly attached data volume /dev/vdc as an example. In your scenario, note the actual device name.
- The expected result is as follows:
- Run the following command to format the filesystem.
- Expected output shows that formatting was successful.
- Run the following command to create a cache directory and mount the data volume to this directory.
- After mounting is complete, check whether the mount is correct.
- The expected output shows that the data volume is correctly mounted to the specified directory.
- Configure automatic mounting of the data volume on system startup.
- Run the following command to obtain the filesystem UUID of the data volume.
- Run the following command to add the configuration item to /etc/fstab. You need to replace <UUID> with your actual value.
- After configuration is complete, check whether the mount is correct.
- The expected output shows that the data volume is correctly mounted to the specified directory.
- Run the following command to configure the node label. In the command, <node_name> is the node name, for example, 192.168.1.10.
- Confirm that the label is correctly configured and effective. In the command, <node_name> is the node name, for example, 192.168.1.10.
- The expected result is as follows:
- Run the following command to check whether the mount point is normal. In the command, <node_name> is the node name, for example, 192.168.1.10.
- The following expected output indicates that the mount point on the node is normal.