k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.79k stars 366 forks source link

How to setup controller and worker on the same machine (still enableling multi-node), but being able to change the kubelet config ? #5265

Closed hl037 closed 2 hours ago

hl037 commented 2 hours ago

Hello, I am quite new to k0s and k8s in general, but I would like to setup a small cluster using k0s.

I have a decent machine on the cloud that should be able to run the controller and a worker. However, this machine has already some stuff on it, and though I have 16 GB available (far enough for the experiment I want to do), it's only 2% of the free fs space, and I get the disk pressure taint.

To overcome that, I would like to be able to edit evictionHard.nodefs.available for this worker. However, though the doc says I can use worker profiles to do that, it's not said how to apply such a profile to a worker...

If I try a k0s install worker, I have a /var/lib/kubeconfig that seems to be a right location to set this option too. But this file is not created using k0s install controller --enable-worker; k0s start.

I also tried to install the worker standalone on the same machine, and start it with k0s worker --status-socket=[other socket than default] --data-dir... But : 1) The --status-socket= seems to have no effect : it still complains the socket (with the default path instead of the override) already exists (since the controller is also started on the same machine) 2) On another node where I have to change the datadir, I still get a warning in stdout about disk pressure on /var/lib/k0s while I had changed the data-dir. (But the pod did not get the taint, and was using the right path).

Since I'm new, I really don't know what is Bug, Feature, or misunderstanding about all that. All I know is that this scenario should be possible, and this is why I reach to you to get some help :)

Thanks !

hl037 commented 2 hours ago

seems like I missed the --profile option...