From fe4ba51d1aecd863438942b7513bf9e042bc5f9f Mon Sep 17 00:00:00 2001
From: Matthew Mosesohn <matthew.mosesohn@gmail.com>
Date: Wed, 11 Oct 2017 15:28:42 +0100
Subject: [PATCH] Set node IP correctly (#1770)

Fixes #1741
---
 roles/kubernetes/node/templates/kubelet.kubeadm.env.j2  | 2 +-
 roles/kubernetes/node/templates/kubelet.standard.env.j2 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 b/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2
index cbf615063..722f567c2 100644
--- a/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2
+++ b/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2
@@ -5,7 +5,7 @@
 KUBE_LOGGING="--logtostderr=true"
 KUBE_LOG_LEVEL="--v={{ kube_log_level }}"
 # The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
-KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }}"
+KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }} {% if ip is defined %} --node-ip={{ ip }}{% endif %}"
 # The port for the info server to serve on
 # KUBELET_PORT="--port=10250"
 # You may leave this blank to use the actual hostname
diff --git a/roles/kubernetes/node/templates/kubelet.standard.env.j2 b/roles/kubernetes/node/templates/kubelet.standard.env.j2
index a7da60e40..b983aefa5 100644
--- a/roles/kubernetes/node/templates/kubelet.standard.env.j2
+++ b/roles/kubernetes/node/templates/kubelet.standard.env.j2
@@ -2,7 +2,7 @@
 KUBE_LOGGING="--logtostderr=true"
 KUBE_LOG_LEVEL="--v={{ kube_log_level }}"
 # The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
-KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }}"
+KUBELET_ADDRESS="--address={{ ip | default("0.0.0.0") }} {% if ip is defined %} --node-ip={{ ip }}{% endif %}"
 # The port for the info server to serve on
 # KUBELET_PORT="--port=10250"
 # You may leave this blank to use the actual hostname
-- 
GitLab