From 127bc01857cde5657c1ed3cbd22c6a16a9c1ac69 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Tue, 19 Dec 2017 20:18:20 +0000 Subject: [PATCH] Do not override kubelet hostname if cloud_provider is used (#2095) Starting with Kubernetes v1.8.4, kubelet ignores the AWS cloud provider string and uses the override hostname, which fails Node admission checks. Fixes #2094 --- roles/kubernetes/node/defaults/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index 2d7242cda..90840dbff 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -78,7 +78,12 @@ kubelet_custom_flags: [] kube_hyperkube_image_repo: "" # If non-empty, will use this string as identification instead of the actual hostname -kube_override_hostname: "{{ ansible_hostname }}" +kube_override_hostname: >- + {% if cloud_provider is defined %} + false + {% else %} + {{ ansible_hostname }} + {% endif %} # cAdvisor port kube_cadvisor_port: 0