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 %}