6

Referencing another answer here, they suggest setting

evictionHard:
  imagefs.available: 1%
  memory.available: 100Mi
  nodefs.available: 1%
  nodefs.inodesFree: 1%

In the file /var/lib/kubelet/config.yaml. However, I do not see that file in my k3s distribution of kubernetes. Where is this file located with k3s?

1 Answer 1

6

/etc/rancher/k3s/config.yaml

Note, /etc/rancher/k3s/config.yaml not /etc/rancher/k3s/k3s.yaml! You may have to create the file if it doesn't exist.

K3s doesn't have a dedicated kubelet service. It's integrated into k3s. So it's configured only with the --kubelet-arg flag to k3s. But you can add Kubelet config directives to your config.yaml (/etc/rancher/k3s/config.yaml),

kubelet-arg:
  - "kube-reserved=cpu=500m,memory=1Gi,ephemeral-storage=2Gi"
  - "system-reserved=cpu=500m, memory=1Gi,ephemeral-storage=2Gi"
  - "eviction-hard=memory.available<500Mi,nodefs.available<10%"

Which would look like,

kubelet-arg:
  - "eviction-hard=imagefs.available<case>,memory.available<case>,nodefs.available<case>,nodefs.inodesFree<case>"

You can find more information at,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.