Default values for the garbage collection related parameters on OCP4
Environment
-
Red Hat OpenShift Container Platform (RHOCP)
- 4.x
-
Red Hat OpenShift Services on AWS (ROSA)
Issue
- How to know the default values for the garbage collection related parameters of the kubelet on OCP4?
Resolution
The default values of each parameter are as follows, which are the ones described at Kubernetes Content from kubernetes.io is not included.documentation.
-
evictionSoftandevictionSoftGracePeriodarenil, which means nothing, by default. -
evictionHardmemory.available < 100Minodefs.available < 10%nodefs.inodesFree < 5%imagefs.available < 15%imagefs.inodesFree = nil
-
evictionPressureTransitionPeriodis5m0sby default (only "ns", "us", "ms", "s", "m", "h" as time suffix unit are allowed). -
Refer to OpenShift documentation for more details of the parameters: Configuring garbage collection for containers and images .
Diagnostic Steps
-
Check the default values within the kubelet service initialization journal logs. It's needed to access to the node to check:
$ oc get nodes [...] $ oc debug node/[node_name] [...] sh-4.4# chroot /host bash # journalctl -u kubelet.service ... FLAG: --eviction-hard="imagefs.available<15%,memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%" ... FLAG: --eviction-pressure-transition-period="5m0s" ... FLAG: --eviction-soft="" ... FLAG: --eviction-soft-grace-period="" -
It is also possible to check the kubelet config this way (change the
${node_name}accordingly):$ oc get --raw /api/v1/nodes/${node_name}/proxy/configz | jq
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.