Ensure haproxy and nginx reload when config changes (#4862)

Change-Id: Ia9a41e7b1cfcb1e6acb2dbae6eecc541dce25a74
pull/4864/head
Matthew Mosesohn 2019-06-10 15:59:08 +03:00 committed by Kubernetes Prow Robot
parent aa63eb6196
commit 3b7797b1a1
4 changed files with 24 additions and 10 deletions

View File

@ -4,11 +4,6 @@
path: "{{ kube_manifest_dir }}/nginx-proxy.yml"
state: absent
- name: haproxy | Write static pod
template:
src: manifests/haproxy.manifest.j2
dest: "{{ kube_manifest_dir }}/haproxy.yml"
- name: haproxy | Make haproxy directory
file:
path: "{{ haproxy_config_dir }}"
@ -23,3 +18,13 @@
owner: root
mode: 0755
backup: yes
- name: haproxy | Get checksum from config
stat:
path: "{{ haproxy_config_dir }}/haproxy.cfg"
register: haproxy_stat
- name: haproxy | Write static pod
template:
src: manifests/haproxy.manifest.j2
dest: "{{ kube_manifest_dir }}/haproxy.yml"

View File

@ -4,11 +4,6 @@
path: "{{ kube_manifest_dir }}/haproxy.yml"
state: absent
- name: nginx-proxy | Write static pod
template:
src: manifests/nginx-proxy.manifest.j2
dest: "{{ kube_manifest_dir }}/nginx-proxy.yml"
- name: nginx-proxy | Make nginx directory
file:
path: "{{ nginx_config_dir }}"
@ -23,3 +18,13 @@
owner: root
mode: 0755
backup: yes
- name: nginx-proxy | Get checksum from config
stat:
path: "{{ nginx_config_dir }}/nginx.conf"
register: nginx_stat
- name: nginx-proxy | Write static pod
template:
src: manifests/nginx-proxy.manifest.j2
dest: "{{ kube_manifest_dir }}/nginx-proxy.yml"

View File

@ -6,6 +6,8 @@ metadata:
labels:
addonmanager.kubernetes.io/mode: Reconcile
k8s-app: kube-haproxy
annotations:
haproxy-cfg-checksum: "{{ haproxy_stat.stat.checksum }}"
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet

View File

@ -6,6 +6,8 @@ metadata:
labels:
addonmanager.kubernetes.io/mode: Reconcile
k8s-app: kube-nginx
annotations:
nginx-cfg-checksum: "{{ nginx_stat.stat.checksum }}"
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet