Skip to content

Commit 786a770

Browse files
Enable graceful node shutdown for 1.29+
1 parent 82ec420 commit 786a770

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

templates/al2/runtime/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 --arg DNS_CLUSTER_IP "$DNS_CLUSTER_IP" '.clusterDNS=($DNS_CLUSTER_IP|split(","))' $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)