Search code examples
kuberneteskubeadm

How can I reconfigure my cluster's kubelets with kubeadm


I am currently trying to find a way to reconfigure the evicition thresholds of all of my clusters kubelets. The cluster has been initialized with kubeadm init and the worker nodes have been added with kubeadmin join.

Now kubeadm has correctly written the kubelet configuration to the kubelet-config-1.16 configmap in the kube-system namespace and I can see the settings there.

However, what I gather from the documentation, updating it in that configmap will not adjust it for the existing kubelets.

Could someone point me to the right resources?

Thank you!


Solution

  • You can create a new ConfigMap from the old ConfigMap and modify it to have desired configuration for eviction threshold and then edit the node’s reference to point to the new ConfigMap with the following command:

    kubectl edit node ${NODE_NAME}
    

    In your text editor, add the following YAML under spec:

    configSource:
        configMap:
            name: CONFIG_MAP_NAME # replace CONFIG_MAP_NAME with the name of the ConfigMap
            namespace: kube-system
            kubeletConfigKey: kubelet
    

    This process is well documented here