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