Fix kube system NS provisioning

NS must be created only on the first kube-master.
This commit is contained in:
Aleksander Morozov 2017-09-27 11:34:25 +03:00
parent 477afa8711
commit b292a1ee0b

View file

@ -17,7 +17,7 @@
- name: Check if kube system namespace exists
command: "{{ bin_dir }}/kubectl get ns {{system_namespace}}"
register: 'kubesystem'
register: check_system_ns
changed_when: False
failed_when: False
when: inventory_hostname == groups['kube-master'][0]
@ -30,7 +30,7 @@
register: create_system_ns
until: create_system_ns.rc == 0
changed_when: False
when: kubesystem.rc != 0 and inventory_hostname == groups['kube-master'][0]
when: inventory_hostname == groups['kube-master'][0] and check_system_ns|failed
tags: apps
- name: Write kube-scheduler kubeconfig