How to Enable Graceful Node Shutdown?
PreviousHow to List all Containers Running in a ClusterNextRestoring ETCD Backup to Recover Cluster From Loss of Quorum
Last updated
# kubectl edit configmap worker-default-kubelet-config -n kube-system
configmap/worker-default-kubelet-config edited# kubectl get configmap worker-default-kubelet-config -n kube-system -o yaml
apiVersion: v1
data:
kubelet: |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
...
featureGates:
DynamicKubeletConfig: true
GracefulNodeShutdown: true
maxPods: 200
shutdownGracePeriod: 30s
shutdownGracePeriodCriticalPods: 10ssudo systemctl start pf9-hostagent# less /var/log/pf9/kubelet/kubelet.INFO | grep "feature gates"
I1208 22:01:52.214565 22305 feature_gate.go:243] feature gates: &{map[]}
I1208 22:01:52.217698 22305 feature_gate.go:243] feature gates: &{map[DynamicKubeletConfig:true]}
I1208 22:01:52.217779 22305 feature_gate.go:243] feature gates: &{map[DynamicKubeletConfig:true]}
I1208 22:01:52.220247 22305 feature_gate.go:243] feature gates: &{map[DynamicKubeletConfig:true GracefulNodeShutdown:true]}
I1208 22:01:52.220355 22305 feature_gate.go:243] feature gates: &{map[DynamicKubeletConfig:true GracefulNodeShutdown:true]}
I1208 22:01:52.243430 22305 feature_gate.go:243] feature gates: &{map[DynamicKubeletConfig:true GracefulNodeShutdown:true]}
I1208 22:01:52.243550 22305 feature_gate.go:243] feature gates: &{map[DynamicKubeletConfig:true GracefulNodeShutdown:true]}[root@worker01 ~]# systemd-inhibit --list
Who: kubelet (UID 0/root, PID 22305/kubelet)
What: shutdown
Why: Kubelet needs time to handle node shutdown
Mode: delay
1 inhibitors listed.