DEV Community

Silpa Nallagopula
Silpa Nallagopula

Posted on

Kubernetes 1.32: soft eviction stops overriding a pod's grace period. One command to see if your nodes use it.

After Nov 26, AWS can move any EKS 1.31 control plane to 1.32 without asking. Managed node groups and self-managed nodes stay on 1.31, and AWS says a cluster upgraded that way can't be rolled back. So the next job is the nodes, and the 1.32 kubelet changes one thing that no Kubernetes object will show you.

What changed

The v1.32.0 changelog lists it under API Change (PR #122890). Before the fix, a pod's terminationGracePeriodSeconds would "always be overwritten by the MaxPodGracePeriodSeconds of the soft eviction".

Up to 1.31, when a node crossed an evictionSoft threshold, the kubelet gave every evicted pod evictionMaxPodGracePeriod seconds to stop, whatever the pod asked for. From 1.32 that value is a ceiling. The kubelet docs call it the maximum allowed grace period for soft eviction. A pod with terminationGracePeriodSeconds: 5 now gets 5 seconds, even when the eviction max is 60.

Hard eviction thresholds don't change. They already use a 0-second grace period.

Check every node (read-only)

for n in $(kubectl get nodes -o name | cut -d/ -f2); do
  echo "== $n"
  kubectl get --raw "/api/v1/nodes/$n/proxy/configz" \
    | jq -c '.kubeletconfig | {evictionMaxPodGracePeriod, evictionSoft}'
done
Enter fullscreen mode Exit fullscreen mode

You need access to nodes/proxy for this. If a node prints {"evictionMaxPodGracePeriod":null,"evictionSoft":null}, soft eviction is off there and nothing changes. A node with soft eviction configured prints both values, for example {"evictionMaxPodGracePeriod":60,"evictionSoft":{"memory.available":"300Mi"}}. That node behaves differently once its kubelet is on 1.32.

What to do about it

On those nodes, look for pods with a short terminationGracePeriodSeconds that relied on the longer shutdown under memory pressure, for example to flush a buffer or drain connections. Raise their own grace period before you upgrade the node group. If you really need the old behaviour, the AllowOverwriteTerminationGracePeriodSeconds feature gate restores it, and the changelog asks anyone who turns it on to file an issue saying why.

Top comments (0)