Plugin Deployment
Import the container image of the Kubernetes NUMA affinity scheduling plugin to all worker nodes, install the plugin on the management node, and verify its deployment status.
Prerequisites
The running of the Kubernetes NUMA affinity scheduling plugin depends on the Kubernetes cluster and containerd container runtime. Before deployment, ensure that the network configuration of the Kubernetes cluster is correct and container instances can be deployed and run properly.
After the operating environment is prepared, enable the NRI function in the containerd configuration file (/etc/containerd/config.toml by default) of the compute node. If the configuration file does not exist, run the following command to create it:
containerd config default > /etc/containerd/config.toml
Enable the NRI function or add it to the configuration file:
[plugins]
...
[plugins."io.containerd.nri.v1.nri"]
disable = false # Enable NRI.
disable_connections = false
plugin_config_path = "/etc/nri/conf.d"
plugin_path = "/opt/nri/plugins"
plugin_registration_timeout = "5s"
plugin_request_timeout = "2s"
socket_path = "/var/run/nri/nri.sock"
Restart containerd and check whether containerd is restarted successfully.
systemctl daemon-reload systemctl restart containerd systemctl status containerd
Worker Node
Import the plugin container image to all worker nodes.
ctr -n k8s.io images import /path/to/numadj-nriplugin.tar
In the preceding command, /path/to/numadj-nriplugin.tar indicates the path of the plugin container image. Replace it with the actual path.
Management Node
- On the management node, go to the k8s-scheduling-tuning-plugin source code directory and run the following command to install the plugin:
cd /path/to/k8s-scheduling-tuning-plugin make plugin_install
In the preceding command, /path/to/k8s-scheduling-tuning-plugin indicates the path of the plugin source code. Replace it with the actual path.
- Verify the plugin deployment status.
Check whether the pod of the plugin has been successfully deployed.
kubectl get pods -A | grep numaadj
If a pod named with numaadj is displayed in the command output and running, the deployment is successful.
1 2 3 4
NAME READY STATUS RESTARTS AGE numaadj-db62k 1/1 Running 0 4m55s numaadj-kmp9p 1/1 Running 0 4m55s numaadj-pqdsx 1/1 Running 0 4m55s
If the pod cannot be started, check the plugin log information.
kubectl logs numaadj-db62k
If the error message "failed to start with initial configuration: failed to start NRI plugin..." is displayed, check whether the containerd NRI function is enabled.
- Optional: Uninstall the plugin if it is not required.
Uninstall the plugin on the management node. This step is optional and is not mandatory for the deployment.
- On the management node, go to the k8s-scheduling-tuning-plugin source code directory and run the following command to uninstall the plugin:
cd /path/to/k8s-scheduling-tuning-plugin make plugin_uninstall
In the preceding command, /path/to/k8s-scheduling-tuning-plugin indicates the path of the plugin source code. Replace it with the actual path.
- Verify the deletion status of the plugin pod.
Check whether the pod of the plugin has been deleted.
kubectl get pods -A | grep numaadj
If the pod named with numaadj is no longer displayed in the command output, the plugin is deleted.
1NAME READY STATUS RESTARTS AGE
- On the management node, go to the k8s-scheduling-tuning-plugin source code directory and run the following command to uninstall the plugin: