HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Where does k3s store it's "/var/lib/kubelet/config.yaml" file?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
varfilek3slibkubeletwherestoreconfigdoesyaml

Problem

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?

Solution

/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

Which would look like,

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


You can find more information at,

  • "Customized Flags for Kubernetes Processes"



  • "K3S Configuration File"

Code Snippets

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

Context

StackExchange DevOps Q#16070, answer score: 6

Revisions (0)

No revisions yet.