How To Change Configuration for Kubelet Service on a Single Worker or Master Node in a PMK Cluster
Problem
How to add additional flags or change values for parameters defined in the set Master/Worker Kubelet configuration file of an individual node by creating a new configuration file and applying the same that will persist through an upgrade on a Platform9 Managed Kubernetes cluster.
Environment
Platform9 Managed Kubernetes - All Versions
Kubernetes up to v1.23
Kubelet
Warning
The Dynamic kubelet configuration feature has been completely removed from Kubernetes v1.24. Therefore, the procedure below only works for Kubernetes clusters up to v1.23.
Please contact Platform9 support, if you have a similar requirement for Kubernetes clusters v1.24 & higher.
Procedure
Choose a node to modify/reconfigure. As an example, we will consider node 10.128.226.33
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
10.128.226.20 NotReady worker 86d v1.13.10
10.128.226.33 Ready worker 86d v1.13.12
10.128.226.7 Ready master 86d v1.13.12Start
kubectl proxyin the background.
Download and unpack the choosen node's current configuration.
Example:
Limit Number of Pods on a Single Node [--max-pods int32 Default: 110]
Edit the newly created configuration file _kubelet_configz_10.128.226.33_and change maxPods parameter as required and save the file.
Create a new ConfigMap resource using the configuration file kubelet_configz_10.128.226.33.
Once the node is edited with the new ConfigMap, the pf9-kubelet service on the node will be restarted. Once restarted, the pf9-kubelet service will start using the new configuration from the set ConfigMap. But in order for this to happen safely without any intervention from other services which keeps track of the status of the pf9-kubelet service, stop the pf9-hostagent &pf9-nodeletd services first on the node.
Now, edit the node reference to point to the new ConfigMap resource.
Start the _pf9-hostagent_service on the master node. This will eventually start the pf9-nodeletd service.
Retrieve the Node configuration and now it should be showing the updated capacity.
Warning
If there are any issues, inspect the status of pf9-kubelet service on the node and further look at /var/log/pf9/kubelet/kubelet.INFO logs.
Last updated
