This is some sort of "umbrella" issue to combine replies for related issues.
Pods go to evicted state...
k3d import-images command several timesCloses #119 Pods go to evicted state after import an image multiple times
Closes #130 [BUG] Running out of space?
docker system prune would fix the issue (temporarily)kubelet's threshold for NodeHasDiskPressure is somewhere around 5% (of space left on the filesystem)Updates from OPs @adibrastegarnia and @alexellis are very welcome :)
Pretty sure this article covers most cases. I'd wager Docker's storage backend is set to something that doesn't properly clean up after itself (like devicemapper), something Docker's documentation discourages in favor of overlay2, unless you run a kernel that doesn't have it.
In my particular case, I've just added --agent-arg '--eviction-hard=imagefs.available<1%,nodefs.available<1%' --agent-arg '--eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%' to my k3d create invocation.
Thanks for this @zer0def! I'll add it to the docs/wiki :+1:
@adibrastegarnia and @alexellis is this of help for you?
@zer0def added to FAQ in dc19eb7
As of today, this is the command format that actually worked for me:
k3d c \
--server-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%' \
--server-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'
@kizzx2 so the same thing, but with server-arg instead of agent-arg? :thinking:
@iwilltry42
Yes, I am on k3d v1.6.0 and the --agent-arg version gives me this warning (and subsequently it doesn't work):
$ k3d c --agent-arg '--eviction-hard=imagefs.available<1%,nodefs.available<1%' --agent-arg '--eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'
INFO[0000] Created cluster network with ID 57edfaa5f42198061311f6642c00be6e34014dbc92da5d0bbe58e05dd9440b65
WARN[0000] --agent-arg supplied, but --workers is 0, so no agents will be created
It's basically the same thing, but with the correct syntax (at least for my case) so that it actually gets passed into kubelet. (note that I also needed to add kubelet-arg in front)
Ah yes, that makes sense @kizzx2 , it depends on your cluster setup. If you only have a single server with no workers, then --server-arg is the way to go (actually having both in multi-node clusters should be correct) :+1:
As this issue seems to be resolved by the kubelet flags, I'm going to close this issue now.
Feel free to reopen if issues persist.
As of today, this is the command format that actually worked for me:
k3d c \ --server-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%' \ --server-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'
k3d create cluster c2021 -w 3 --k3s-server-arg '--kubelet-arg=eviction-hard=imagefs.available<1%,nodefs.available<1%' \
--k3s-server-arg '--kubelet-arg=eviction-minimum-reclaim=imagefs.available=1%,nodefs.available=1%'
for v3: https://k3d.io/faq/faq/#pods-evicted-due-to-lack-of-disk-space