Open infinitydon opened 2 months ago
This relates heavily on the same findings as in #4255 . Essentially we need to figure out better way to "default" cgroup settings without hardcoding anything like we do in some places currently
Thanks @jnummelin - Should I keep this issue open or close it in favor of #4255 and use that to track this feature also?
I think leaving this open is fair, as this is a real blocker, i.e. there's no way to use CPUManager with k0s right now, unfortunately.
(And I consider this a bug, since nobody expected CPUManager not to work with k0s.)
@twz123 - Noted, I will leave it open
I think leaving this open is fair, as this is a real blocker, i.e. there's no way to use CPUManager with k0s right now, unfortunately.
(And I consider this a bug, since nobody expected CPUManager not to work with k0s.)
To be clear, CPUManager can be used with k0s just not with reservedSystemCPUs
. I installed k0s with arg --kubelet-extra-args='--cpu-manager-policy=static'
and kubelet is running without error and I can see log entries for cpu_manager
Ah, good to know. Still, the hard coded cgroup related settings in k0s are something that needs to be addressed somehow.
In my case (k0sctl version: v0.17.5), --kubelet-extra-args='--cpu-manager-policy=static'
was not enough, I had also set the resources reservation parameters:
installFlags:
- --debug
- --disable-components=konnectivity-server,metrics-server
- --kubelet-extra-args='--cpu-manager-policy=static --kube-reserved=cpu=500m,memory=1Gi --kube-reserved-cgroup=system.slice --kubelet-cgroups=/system.slice/containerd.service'
I had also set the resources reservation parameters:
Correct! I'm also specifying those (I should have mentioned that my previous comment).
The issue is marked as stale since no activity has been recorded in 30 days
If you look at the issue #4234 I found a hack to allow override kubelet parameters. The default kubelet-config.yaml
overrides some parameters even if you try to pass them directly as extra args. However you can build your own kubelet-config.yaml
file and pass it to kubelet with --kubelet-extra-args=--config=/var/lib/k0s/kubelet-ext-config.yaml
.
But you'll then be facing another problem I have not yet solved. Putting limits to a cgroup and running k0s inside this cgroup works but kubelet will still use the system limits and the eviction mechanism does not work as expected.
Is your feature request related to a problem? Please describe.
Currently trying to bring a single node with CPUManager static policy with the following k0s.yaml:
I used this command for the installation: k0s install controller --profile custom-cpu --single -c /etc/k0s/k0s.yaml
But k0s is adding a conflicting parameter that won't allow the CPUManager policy to be applied, below is the eventual kubelet-config.yaml:
It is adding kubeReservedCgroup and kubeletCgroups and this seems to be hard-coded in the code:
With this the kubelet daemon can not start up, gives the following error:
run.go:74] \"command failed\" err=\"failed to validate kubelet configuration, error: invalid configuration: can't use reservedSystemCPUs (--reserved-cpus) with systemReservedCgroup
Describe the solution you would like
Support cpuManagerPolicy and reservedSystemCPUs in the kubelet configuration
Describe alternatives you've considered
No response
Additional context
No response