How to Enable Graceful Node Shutdown?

Problem

  • How to Enable Graceful Node Shutdown in a PMK cluster?

Environment

  • Platform9 Managed Kubernetes - v5.2 Onward

  • Kubernetes - v1.20 and Above

Procedure

  • For enabling Graceful Node Shutdown feature, there are changes that needs to be made to the node's Kubelet configuration.

  • For a cluster with Kubernetes version 1.20, it is required to explicitly enable the GracefulNodeShutdown feature under the featureGates (as it is a alpha feature). For Kubernetes v1.21 onward, it is enabled by default (as it is a beta feature).

  • To enable the GracefulNodeShutdown under the featureGates, edit the required master/worker configmap . Along with the feature gate, there is a requirement to set values ShutdownGracePeriod & ShutdownGracePeriodCriticalPods (by default are set to zero).

circle-exclamation
sudo systemctl stop pf9-{hostagent,nodeletd}
  • There are 2 different default-kubelet-config configmaps under the namespace kube-system, one for master nodes master-default-kubelet-config and other for worker nodes worker-default-kubelet-config.

  • Edit appropriate configmap according to the requirement. e.g. in this case we are changing the worker configmap.

  • Start the pf9-hostagent service on all the worker/master nodes where the service was stopped initially. This will eventually start the pf9-nodeletd service.

  • Verify if the GracefulNodeShutdown feature has been enabled or not from the worker node post editing the configmap.

Additional Information

Last updated