Skip to content

Commit

Permalink
Enable graceful node shutdown for 1.29+
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon committed Dec 13, 2023
1 parent e65bc14 commit d858a25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions files/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ fi
KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json
echo "$(jq ".clusterDNS=[\"$DNS_CLUSTER_IP\"]" $KUBELET_CONFIG)" > $KUBELET_CONFIG

if vercmp "$KUBELET_VERSION" gteq "1.29.0"; then
echo "$(jq ".shutdownGracePeriod=\"45s\"" $KUBELET_CONFIG)" > $KUBELET_CONFIG
echo "$(jq ".shutdownGracePeriodCriticalPods=\"15s\"" $KUBELET_CONFIG)" > $KUBELET_CONFIG
fi

if [[ "${IP_FAMILY}" == "ipv4" ]]; then
INTERNAL_IP=$(imds 'latest/meta-data/local-ipv4')
else
Expand Down

0 comments on commit d858a25

Please sign in to comment.