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).

In order for this to happen safely without any intervention from other services which keeps track of the status of the pf9-kubelet service, first stop the pf9-hostagent & pf9-nodeletd services on ALL the worker/master nodes depending on which configmap is being edited.

Copy
  • 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.
Enable GracefulNodeShutdown under the featureGates
Copy
Example
Copy
  • 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.
Command
Copy
  • Verify if the GracefulNodeShutdown feature has been enabled or not from the worker node post editing the configmap.
Example
Copy
Verifying Enablement of GracefulNodeShutdown from Worker Node
Copy

Additional Information

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard