Skip to content

Commit d858a25

Browse files
Enable graceful node shutdown for 1.29+
1 parent e65bc14 commit d858a25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

files/bootstrap.sh

+5
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,11 @@ fi
482482
KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json
483483
echo "$(jq ".clusterDNS=[\"$DNS_CLUSTER_IP\"]" $KUBELET_CONFIG)" > $KUBELET_CONFIG
484484

485+
if vercmp "$KUBELET_VERSION" gteq "1.29.0"; then
486+
echo "$(jq ".shutdownGracePeriod=\"45s\"" $KUBELET_CONFIG)" > $KUBELET_CONFIG
487+
echo "$(jq ".shutdownGracePeriodCriticalPods=\"15s\"" $KUBELET_CONFIG)" > $KUBELET_CONFIG
488+
fi
489+
485490
if [[ "${IP_FAMILY}" == "ipv4" ]]; then
486491
INTERNAL_IP=$(imds 'latest/meta-data/local-ipv4')
487492
else

0 commit comments

Comments
 (0)