Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable graceful node shutdown for 1.30+ on AL2 #1544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions templates/al2/provisioners/install-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ fi

sudo mv "${WORKING_DIR}/runtime.slice" /etc/systemd/system/runtime.slice

if vercmp "${KUBERNETES_VERSION}" gteq "1.30.0"; then
# increase the max inhibit delay to accommodate kubelet's graceful shutdown procedure
cat << EOF | sudo tee /etc/systemd/logind.conf.d/00-kubelet-graceful-shutdown.conf
InhibitDelayMaxSec=45
EOF
fi

###############################################################################
### Containerd setup ##########################################################
###############################################################################
Expand Down
5 changes: 5 additions & 0 deletions templates/al2/runtime/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 --arg DNS_CLUSTER_IP "$DNS_CLUSTER_IP" '.clusterDNS=($DNS_CLUSTER_IP|split(","))' $KUBELET_CONFIG) > $KUBELET_CONFIG

if vercmp "$KUBELET_VERSION" gteq "1.30.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
Loading