Plugin Deployment
Deploy Kunpeng TAP on the target compute node and verify the running status of the plugin.
Prerequisites
Kunpeng TAP depends on the Kubernetes cluster. Currently, Docker that adopts Dockershim for communication and containerd runtimes are supported. Before deployment, ensure that the network configuration of the Kubernetes cluster is correct and container instances can be deployed and run properly.
Procedure
- Import the executable file of Kunpeng TAP to the target compute node.
- Start Kunpeng TAP.Method 1: Use systemd to start Kunpeng TAP. Go to the source code directory and run the make command to install and start Kunpeng TAP.
- Go to the source code directory.
cd /path/to/topology-affinity-plugin
In the preceding command, replace /path/to/topology-affinity-plugin with the actual path to the Kunpeng TAP source code.
- Install the plugin. By default, the plugin is started in Docker.
make install-service
- To specify Docker as the runtime, use the following installation command:
make install-service-docker
If you need to modify startup parameters, modify the parameters under ExecStart= in the hack/kunpeng-tap.service.docker file in the source code directory.
[Unit] Description=Kunpeng Topology-Affinity Plugin Service After=network.target [Service] ExecStart=/usr/local/bin/kunpeng-tap --runtime-proxy-endpoint="/var/run/kunpeng/tap-runtime-proxy.sock" \ --container-runtime-service-endpoint="/var/run/docker.sock" --container-runtime-mode="Docker" \ --resource-policy="numa-aware" Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
To specify containerd as the runtime, use the following installation command. You can modify the parameters in the hack/kunpeng-tap.service.containerd file in the source code directory.
make install-service-containerd
- After the installation is complete, run the following command to start the plugin and automatically check the service status after the plugin is started:
1make start-service - Check log information.
1journalctl -u kunpeng-tap
Method 2: Start the plugin directly.- Example startup commands in Docker:
kunpeng-tap --runtime-proxy-endpoint="/var/run/kunpeng/tap-runtime-proxy.sock" \ --container-runtime-service-endpoint="/var/run/docker.sock" --container-runtime-mode="Docker" \ --resource-policy="numa-aware" - Example startup commands in containerd:
kunpeng-tap --runtime-proxy-endpoint="/var/run/kunpeng/tap-runtime-proxy.sock" \ --container-runtime-service-endpoint="/var/run/containerd/containerd.sock" --container-runtime-mode="Containerd" \ --resource-policy="numa-aware"
You can modify the parameters in the startup commands as required. Table 1 describes the parameters.
Table 1 Parameter description Parameter
Description
Default Value
Configuration Principle
container-runtime-mode
Container runtime connected to the plugin, which can be Docker or containerd.
Docker
Determine the container runtime according to that used in the Kubernetes cluster.
resource-policy
Container resource optimization policy. Currently, numa-aware and topology-aware are supported.
- numa-aware supports CPU NUMA affinity for containers of the Burstable type.
- topology-aware provides CPU affinity at the socket, die, and NUMA levels, and supports memory and GPU resource optimization.
numa-aware
Select a policy as required.
enable-memory-topology
After the topology-aware policy is enabled (by setting --resource-policy=topology-aware), the memory NUMA optimization function is disabled by default. To enable NUMA affinity for container memory, set --enable-memory-topology=true.
false
This configuration is in the alpha phase.
v
Log level. The value ranges from 2 to 5.
2
The higher the level, the more detailed the logs.
- Go to the source code directory.
- Configure kubelet parameters on the compute node.To enable Kunpeng TAP to successfully process requests from kubelet, add a parameter to the kubelet command line configurations.
- In the Docker scenario, add or modify the following parameter in the kubelet startup parameters:
1--docker-endpoint=unix:///var/run/kunpeng/tap-runtime-proxy.sockFor example, when using kubeadm to install a cluster, you can add parameters to /var/lib/kubelet/kubeadm-flags.env.
KUBELET_KUBEADM_ARGS="--network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.6 --docker-endpoint=unix:///var/run/kunpeng/tap-runtime-proxy.sock"
After the kubelet parameter is modified, run the following commands to restart the kubelet:
systemctl daemon-reload systemctl restart kubelet
- In the containerd scenario, modify the following kubelet startup parameter.
--container-runtime=remote --container-runtime-endpoint=unix:///var/run/kunpeng/tap-runtime-proxy.sock
In this case, parameters in /var/lib/kubelet/kubeadm-flags.env can be:
KUBELET_KUBEADM_ARGS="--network-plugin=cni --pod-infra-container-image=k8s.gcr.io/pause:3.6 --container-runtime=remote --container-runtime-endpoint=unix:///var/run/kunpeng/tap-runtime-proxy.sock"
After the kubelet parameter is modified, run the following commands to restart the kubelet:
systemctl daemon-reload systemctl restart kubelet
- In the Docker scenario, add or modify the following parameter in the kubelet startup parameters: