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
GracefulNodeShutdownfeature 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
GracefulNodeShutdownunder the featureGates, edit the required master/workerconfigmap. Along with the feature gate, there is a requirement to set valuesShutdownGracePeriod&ShutdownGracePeriodCriticalPods(by default are set to zero).
Warning
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.
sudo systemctl stop pf9-{hostagent,nodeletd}There are 2 different
default-kubelet-configconfigmaps under the namespacekube-system, one for master nodesmaster-default-kubelet-configand other for worker nodesworker-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
