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?
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/