From e67886bf9db49ed9cb7d864d7d2a32239b2e6406 Mon Sep 17 00:00:00 2001 From: Lennart Weller Date: Fri, 25 Sep 2020 17:21:11 +0200 Subject: [PATCH] add leader election timeouts and durations to available parameters (#6691) --- roles/kubernetes/master/defaults/main/main.yml | 7 +++++++ .../master/templates/kubeadm-config.v1beta2.yaml.j2 | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/roles/kubernetes/master/defaults/main/main.yml b/roles/kubernetes/master/defaults/main/main.yml index bf5efa6a1..ac304ae52 100644 --- a/roles/kubernetes/master/defaults/main/main.yml +++ b/roles/kubernetes/master/defaults/main/main.yml @@ -28,6 +28,13 @@ kube_etcd_key_file: node-{{ inventory_hostname }}-key.pem kube_controller_manager_bind_address: 0.0.0.0 kube_scheduler_bind_address: 0.0.0.0 +# Leader election lease durations and timeouts for scheduler and controller-manager +kube_controller_manager_leader_elect_lease_duration: 15s +kube_controller_manager_leader_elect_renew_deadline: 10s + +kube_scheduler_leader_elect_lease_duration: 15s +kube_scheduler_leader_elect_renew_deadline: 10s + # discovery_timeout modifies the discovery timeout discovery_timeout: 5m0s diff --git a/roles/kubernetes/master/templates/kubeadm-config.v1beta2.yaml.j2 b/roles/kubernetes/master/templates/kubeadm-config.v1beta2.yaml.j2 index 88c14ac9c..c0d5b5316 100644 --- a/roles/kubernetes/master/templates/kubeadm-config.v1beta2.yaml.j2 +++ b/roles/kubernetes/master/templates/kubeadm-config.v1beta2.yaml.j2 @@ -262,6 +262,8 @@ controllerManager: profiling: "{{ kube_profiling }}" terminated-pod-gc-threshold: "{{ kube_controller_terminated_pod_gc_threshold }}" bind-address: {{ kube_controller_manager_bind_address }} + leader-elect-lease-duration: {{ kube_controller_manager_leader_elect_lease_duration }} + leader-elect-renew-deadline: {{ kube_controller_manager_leader_elect_renew_deadline }} {% if kube_feature_gates %} feature-gates: {{ kube_feature_gates|join(',') }} {% endif %} @@ -307,6 +309,8 @@ controllerManager: scheduler: extraArgs: bind-address: {{ kube_scheduler_bind_address }} + leader-elect-lease-duration: {{ kube_scheduler_leader_elect_lease_duration }} + leader-elect-renew-deadline: {{ kube_scheduler_leader_elect_renew_deadline }} {% if kube_feature_gates %} feature-gates: {{ kube_feature_gates|join(',') }} {% endif %}