Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

I wonder that how to enable shutdownGracePeriod time on GKE

I wonder that how to enable shutdownGracePeriod time on GKE

I heard that Kubernetes supports shutdownGracePeriod starting from version 1.21.

How can I apply it on GKE? If it can be applied, can it also be applied to node autoscaler?

1 1 368
1 REPLY 1

Hey! Yep, Kubernetes added shutdownGracePeriod in v1.21. To use it on GKE, make sure your cluster is running at least that version. You can set it in your Pod spec like this:

apiVersion: v1
kind: Pod
spec:
terminationGracePeriodSeconds: 30
shutdownGracePeriod:
duration: 60s

As for the node autoscaler, it doesn't directly support shutdownGracePeriod, but you can manage graceful shutdowns using PodDisruptionBudgets (PDBs). Please check more info on PDBs here, hope that helps: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/

Top Labels in this Space