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

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
Example
Copy
  • Start kubectl proxy in the background.
Example
Copy
  • Download and unpack the choosen node's current configuration.
Example
Copy

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.
Example
Copy
  • 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.
Command
Copy
  • Now, edit the node reference to point to the new ConfigMap resource.
Example
Copy
Spec Changes
Copy
  • Start the pf9-hostagent_service on the master node. This will eventually start the _pf9-nodeletd service.
Command
Copy
  • Retrieve the Node configuration and now it should be showing the updated capacity.
Copy

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.

If there is a need to make changes to the Kubelet configuration on ALL Master/Worker nodes, we can modify one or both of the set ConfigMaps. Reference: How To Change Configuration for Kubelet Service on All Worker or Master Nodes in a PMK Cluster

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard