From a517a8db0123e7465c2d0a8528b572be5ee48b1b Mon Sep 17 00:00:00 2001 From: Cristian Calin <6627509+cristicalin@users.noreply.github.com> Date: Wed, 22 Sep 2021 04:34:00 +0300 Subject: [PATCH] Drop chech for kubelet_shutdown_grace_period (#7993) and kubelet_shutdown_grace_period_critical_pods as ansible cannot do sane time interval calculations --- inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml | 2 ++ roles/kubernetes/preinstall/tasks/0020-verify-settings.yml | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml b/inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml index 5d09eef47..1edd5f502 100644 --- a/inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml +++ b/inventory/sample/group_vars/k8s_cluster/k8s-cluster.yml @@ -150,6 +150,8 @@ kube_proxy_nodeport_addresses: >- kube_encrypt_secret_data: false # Graceful Node Shutdown (Kubernetes >= 1.21.0), see https://kubernetes.io/blog/2021/04/21/graceful-node-shutdown-beta/ +# kubelet_shutdown_grace_period had to be greater than kubelet_shutdown_grace_period_critical_pods to allow +# non-critical podsa to also terminate gracefully # kubelet_shutdown_grace_period: 60s # kubelet_shutdown_grace_period_critical_pods: 20s diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml index d78d751bc..3fc840d5a 100644 --- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml @@ -107,13 +107,6 @@ - not ignore_assert_errors - inventory_hostname in groups['kube_node'] -- name: Stop when ShutdownGracePeriod less than ShutdownGracePeriodCriticalPods - assert: - that: kubelet_shutdown_grace_period > kubelet_shutdown_grace_period_critical_pods - 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', '>=') - - name: Stop when dynamic_kubelet_configuration enabled for kubernetes >= 1.22 assert: that: not dynamic_kubelet_configuration