diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml index d78d751bc48..42260757a24 100644 --- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml @@ -109,7 +109,7 @@ - name: Stop when ShutdownGracePeriod less than ShutdownGracePeriodCriticalPods assert: - that: kubelet_shutdown_grace_period > kubelet_shutdown_grace_period_critical_pods + that: kubelet_shutdown_grace_period|int > kubelet_shutdown_grace_period_critical_pods|int msg: "ShutdownGracePeriod ({{ kubelet_shutdown_grace_period }}) needs to be greater than ShutdownGracePeriodCriticalPods ({{ kubelet_shutdown_grace_period_critical_pods }}) in order to give normal pods time to be evacuated, please see https://kubernetes.io/blog/2021/04/21/graceful-node-shutdown-beta/ for details" when: - kube_version is version('v1.21.0', '>=') diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 0205e3c51bb..9bfca33602f 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -233,6 +233,10 @@ kube_profiling: false # Graceful Node Shutdown # This requires kubernetes >= 1.21.0 +# +# Note, when using both kubelet_shutdown_grace_period and kubelet_shutdown_grace_period_critical_pods +# ensure to use the same meaasurement unit (i.e. s=seconds, m=minutes) because ansible is not aware +# of the variable type and can cause an assertion failure when validating your input kubelet_shutdown_grace_period: 60s # kubelet_shutdown_grace_period_critical_pods should be less than kubelet_shutdown_grace_period # to give normal pods time to be gracefully evacuated