14

I basically want to find the hard eviction strategy that kubelet is currently using.
I checked the settings in the /etc/systemd/system/kubelet.service file on my K8s node. In that the strategy I mentioned is as follows:
--eviction-hard=nodefs.available<3Gi

However, my pods seem to be evicted when the nodefs.available is <10% (default kubernetes settings) I have been unable to find a way a way to know the current parameters that are being used by kubernetes.

Amanjeet Singh
  • 323
  • 1
  • 3
  • 8
  • For posterity, note the /etc/eks/bootstrap.sh overwrites the evictionHard value in the config JSON, and will run after any userdata script you might provide. However, KUBELET_EXTRA_ARGS such as set in bootstrap.sh sets in /etc/systemd/system/kubelet.service.d/30-kubelet-extra-args.conf take precedence over JSON config values. – markfickett May 18 '23 at 15:07

2 Answers2

18

It is possible to dump the current kubelet configuration using kubectl proxy along with the /api/v1/nodes/${TARGET_NODE_FOR_KUBELET}/proxy/configz path, details see linked Kubernetes docs.

Michael Hausenblas
  • 13,162
  • 4
  • 52
  • 66
10

You can use kubectl for that:

kubectl get --raw "/api/v1/nodes/<nodename>/proxy/configz" | jq

Just make sure you replace <nodename> with your node name. And if you don't have jq installed, leave out the | jq part as that's only for formatting.

Sam
  • 5,375
  • 2
  • 45
  • 54