Dynamic Kubelet Configuration

If we wish to change the kubelet configuration on a live cluster, we can use the dynamic kubelet configuration feature provided by Kubernetes. The dynamic kubelet configuration saves us the effort of bringing down a live cluster to make changes to reconfigure kubelet. The dynamic kubelet configuration is achieved via API calls or by using the command line.

On Platform9's Managed Kubernetes, separate ConfigMaps are present for both master and worker nodes on the Kubernetes control plane by default.

The kubelet on the worker nodes is automatically configured using the worker ConfigMap, and the kubelet on the master nodes is automatically configured using the master ConfigMap. We do not have to explicitly create a ConfigMap for the masters or for the worker nodes. If we need to make changes to the overall kubelet configuration, we can modify one or both of the ConfigMaps.

circle-info

Note

The name of the ConfigMap for the master in a cluster is master-default-kubelet-config, and the name of the ConfigMap for the worker node in a cluster is worker-default-kubelet-config.

Using the dynamic kubelet configuration, we can incorporate changes to one or more parameters in the ConfigMaps. All nodes running kubelet that use the configuration will detect the changes in the dynamic kubelet configuration and then integrate those changes into the ConfigMap settings and then restarts the kubelet service. Once restarted, the kubelet service uses the new configuration in the ConfigMap. For more information on dynamic kubelet configuration, refer to the Kubernetes documentationarrow-up-right or to the Kubelet configurationarrow-up-right documentation.

View ConfigMap

To view ConfigMap, run the following command in the CLI.

kubectl get configmap -n kube-system <configmap name> -o <output format>

Use the following command to view the master ConfigMap in yaml format.

Edit ConfigMap

circle-exclamation

Run the following command to edit a ConfigMap.

To edit the ConfigMap on worker nodes, run the following command.

Edit the required parameters in the file and then save the changes.

circle-info

Info

The commands used to edit and save the file will vary depending on the editor used.

Once the changes are made and saved, the changes will take effect automatically when the respective node is discovered. No specific command need to be run for the changes to take effect.

Last updated

Was this helpful?