Conditionally add graceful shutdown Kubelet config

Signed-off-by: torredil <torredil@amazon.com>
This commit is contained in:
torredil 2024-06-18 14:31:11 +00:00
parent 6e8e1f53b0
commit a365eddf79
No known key found for this signature in database

View File

@ -1029,6 +1029,18 @@ authentication:
x509:
clientCAFile: /etc/srv/kubernetes/pki/ca-certificates.crt
EOF
if [[ -n "${SHUTDOWN_GRACE_PERIOD:-}" ]]; then
cat <<EOF
shutdownGracePeriod: ${SHUTDOWN_GRACE_PERIOD}
EOF
fi
if [[ -n "${SHUTDOWN_GRACE_PERIOD_CRITICAL_PODS:-}" ]]; then
cat <<EOF
shutdownGracePeriodCriticalPods: ${SHUTDOWN_GRACE_PERIOD_CRITICAL_PODS}
EOF
fi
}
# cat the Kubelet config yaml for windows nodes