> For the complete documentation index, see [llms.txt](https://docs.platform9.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform9.com/managed-kubernetes/5.7/advanced-cluster-configuration/dynamic-kubelet-configuration.md).

# 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.

{% hint style="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*.
{% endhint %}

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 documentation](https://kubernetes.io/blog/2018/07/11/dynamic-kubelet-configuration/) or to the [Kubelet configuration](https://pkg.go.dev/k8s.io/kubelet/config/v1beta1?utm_source=godoc#KubeletConfiguration) documentation.

## View ConfigMap

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

{% tabs %}
{% tab title="Bash" %}

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

{% endtab %}
{% endtabs %}

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

<figure><img src="https://351724846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSO0ts94Xucvw1aQnUua%2Fuploads%2Fgit-blob-d27a5ed95016f6864345e52c89d3636c9b368df1%2F1605283528.png?alt=media" alt=""><figcaption></figcaption></figure>

## Edit ConfigMap

{% hint style="warning" %}
**Warning**

Before we make a change to a ConfigMap, we must be aware of how the change may impact the function of the cluster. If the cluster fails due to a modification, the cluster will resume operation using the previous working version of the respective ConfigMap.
{% endhint %}

Run the following command to edit a ConfigMap.

{% tabs %}
{% tab title="Bash" %}

```bash
kubectl edit configmap -n kube-system <configmap name> -o <output format>
```

{% endtab %}
{% endtabs %}

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

{% tabs %}
{% tab title="Bash" %}

```bash
kubectl edit configmap -n kube-system worker-default-kubelet-config -o yaml
```

{% endtab %}
{% endtabs %}

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

{% hint style="info" %}
**Info**

The commands used to edit and save the file will vary depending on the editor used.
{% endhint %}

<figure><img src="https://351724846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHSO0ts94Xucvw1aQnUua%2Fuploads%2Fgit-blob-8ade28742316614b868e94835c697dc1ecfcd06e%2F1605283548.png?alt=media" alt=""><figcaption></figcaption></figure>

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.platform9.com/managed-kubernetes/5.7/advanced-cluster-configuration/dynamic-kubelet-configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
