From 126d4e36c832dd5642b2270a95eca9c3ecff823e Mon Sep 17 00:00:00 2001
From: Smaine Kahlouch <smaine.kahlouch@arkena.com>
Date: Mon, 30 Nov 2015 16:41:22 +0100
Subject: [PATCH] Fix kube-proxy on master

---
 roles/kubernetes/master/tasks/config.yml   | 7 +++++--
 roles/kubernetes/master/templates/proxy.j2 | 3 ++-
 roles/kubernetes/node/tasks/config.yml     | 2 --
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/roles/kubernetes/master/tasks/config.yml b/roles/kubernetes/master/tasks/config.yml
index 5c4daeaa2..af699c8f2 100644
--- a/roles/kubernetes/master/tasks/config.yml
+++ b/roles/kubernetes/master/tasks/config.yml
@@ -45,8 +45,11 @@
 - name: write the kubecfg (auth) file for kubectl
   template: src=kubectl.kubeconfig.j2 dest={{ kube_config_dir }}/kubectl.kubeconfig backup=yes
 
-- name: write the config files for proxy
-  template: src=proxy.j2 dest={{ kube_config_dir }}/proxy backup=yes
+- name: Create proxy environment vars dir
+  file: path=/etc/systemd/system/kube-proxy.service.d state=directory
+
+- name: Write proxy config file
+  template: src=proxy.j2 dest=/etc/systemd/system/kube-proxy.service.d/10-proxy-cluster.conf backup=yes
   notify:
     - restart proxy
 
diff --git a/roles/kubernetes/master/templates/proxy.j2 b/roles/kubernetes/master/templates/proxy.j2
index 1dc680e36..33f811a53 100644
--- a/roles/kubernetes/master/templates/proxy.j2
+++ b/roles/kubernetes/master/templates/proxy.j2
@@ -4,4 +4,5 @@
 # default config should be adequate
 
 # Add your own!
-KUBE_PROXY_ARGS="--kubeconfig={{ kube_config_dir }}/proxy.kubeconfig --proxy-mode={{kube_proxy_mode}}"
+[Service]
+Environment="KUBE_PROXY_ARGS=--kubeconfig={{ kube_config_dir }}/proxy.kubeconfig --proxy-mode={{kube_proxy_mode}}"
diff --git a/roles/kubernetes/node/tasks/config.yml b/roles/kubernetes/node/tasks/config.yml
index 27aea7c09..c1d5f29b2 100644
--- a/roles/kubernetes/node/tasks/config.yml
+++ b/roles/kubernetes/node/tasks/config.yml
@@ -20,7 +20,6 @@
 - name: Write kubelet config file
   template: src=kubelet.j2 dest=/etc/systemd/system/kubelet.service.d/10-kubelet.conf backup=yes
   notify:
-    - reload systemd
     - restart kubelet
 
 - name: write the kubecfg (auth) file for kubelet
@@ -34,7 +33,6 @@
 - name: Write proxy config file
   template: src=proxy.j2 dest=/etc/systemd/system/kube-proxy.service.d/10-proxy-cluster.conf backup=yes
   notify:
-    - reload systemd
     - restart proxy
 
 - name: write the kubecfg (auth) file for kube-proxy
-- 
GitLab