From 9fa995ac9d595cc75695fb8b977ac2dd75328c46 Mon Sep 17 00:00:00 2001 From: Dann Bohn Date: Fri, 23 Mar 2018 08:33:25 -0400 Subject: [PATCH] only sets nodeName in kubeadm-config when kube_override_hostname is set --- roles/kubernetes/master/templates/kubeadm-config.yaml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 b/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 index dc842a5e6..b2d2cd2e7 100644 --- a/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 +++ b/roles/kubernetes/master/templates/kubeadm-config.yaml.j2 @@ -83,5 +83,7 @@ apiServerCertSANs: {% endfor %} certificatesDir: {{ kube_config_dir }}/ssl unifiedControlPlaneImage: "{{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}" +{% if kube_override_hostname|default('') %} nodeName: {{ inventory_hostname }} +{% endif %}