I'm trying to change the CPU Manager Policy for a Kubernetes cluster that I manage, as described here however, I've run into numerous issues while doing so.
The cluster is running in DigitalOcean and here is what I've tried so far.
- 1. Since the article mentions that
--cpu-manager-policy
is a kubelet option I assume that I cannot change it via the API Server and have to change it manually on each node. (Is this assumption BTW?) - 2. I
ssh
into one of the nodes (droplets in DigitalOcean lingo) and runkubelet --cpu-manager-policy=static
command as described in the kubelet CLI reference here. It gives me the messageFlag --cpu-manager-policy has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
- 3. So I check the file pointed at by the --config flag by running
ps aux | grep kubelet
and find that its/etc/kubernetes/kubelet.conf
. - 4. I edit the file and add a line
cpuManagerPolicy: static
to it, and alsokubeReserved
andsystemReserved
because they become required fields if specifyingcpuManagerPolicy
. - 5. Then I kill the process that was running the process and restart it. A couple other things showed up (delete this file and drain the node etc) that I was able to get through and was able to restart the kubelet ultimately
I'm a little lost about the following things
- How do I need to do this for all nodes? My cluster has 12 of them and doing all of these steps for each seems very inefficient.
- Is there any way I can set these params from the globally i.e. cluster-wide rather than doing node by node?
- How can I even confirm that what I did actually changed the CPU Manager policy?