From 95b8ac5f62816fd8e3e7547e14d047aadf51dba5 Mon Sep 17 00:00:00 2001 From: Maxim Krasilnikov Date: Mon, 5 Feb 2018 16:49:13 +0300 Subject: [PATCH] Added optional controller and scheduler extra args to kubeadm config (#2205) --- roles/kubernetes/master/defaults/main.yml | 5 ++++- roles/kubernetes/master/templates/kubeadm-config.yaml.j2 | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/master/defaults/main.yml b/roles/kubernetes/master/defaults/main.yml index 6d32003e4..69e74cf83 100644 --- a/roles/kubernetes/master/defaults/main.yml +++ b/roles/kubernetes/master/defaults/main.yml @@ -83,8 +83,11 @@ controller_mgr_custom_flags: [] scheduler_custom_flags: [] # kubeadm settings -# Value of 0 means it never expires +## Value of 0 means it never expires kubeadm_token_ttl: 0 +## Extra args for k8s components passing by kubeadm +kube_kubeadm_controller_extra_args: {} +kube_kubeadm_scheduler_extra_args: {} ## Variable for influencing kube-scheduler behaviour volume_cross_zone_attachment: false diff --git a/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 b/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 index c1bb41f74..eafe6f851 100644 --- a/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 +++ b/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 @@ -67,6 +67,15 @@ controllerManagerExtraArgs: {% if kube_feature_gates %} feature-gates: {{ kube_feature_gates|join(',') }} {% endif %} +{% for key in kube_kubeadm_controller_extra_args %} + {{ key }}: {{ kube_kubeadm_controller_extra_args[key] }} +{% endfor %} +{% if kube_kubeadm_scheduler_extra_args|length > 0 %} +schedulerExtraArgs: +{% for key in kube_kubeadm_scheduler_extra_args %} + {{ key }}: {{ kube_kubeadm_scheduler_extra_args[key] }} +{% endfor %} +{% endif %} apiServerCertSANs: {% for san in apiserver_sans.split(' ') | unique %} - {{ san }}