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

circle-exclamation

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.12
  • Start kubectl proxy in 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.

circle-exclamation
circle-info

Info

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 Clusterarrow-up-right

Last updated