|
|
@ -56,15 +56,24 @@ |
|
|
|
delay: 10 |
|
|
|
timeout: 60 |
|
|
|
|
|
|
|
- name: Create 'kube-system' namespace |
|
|
|
uri: |
|
|
|
url: http://127.0.0.1:{{ kube_apiserver_insecure_port }}/api/v1/namespaces |
|
|
|
method: POST |
|
|
|
body: "{{namespace_kubesystem|to_json}}" |
|
|
|
status_code: 201,409 |
|
|
|
- name: copy 'kube-system' namespace manifest |
|
|
|
copy: src=namespace.yml dest=/etc/kubernetes/kube-system-ns.yml |
|
|
|
run_once: yes |
|
|
|
when: inventory_hostname == groups['kube-master'][0] |
|
|
|
|
|
|
|
- name: Check if kube-system exists |
|
|
|
command: kubectl get ns kube-system |
|
|
|
register: 'kubesystem' |
|
|
|
changed_when: False |
|
|
|
ignore_errors: yes |
|
|
|
run_once: yes |
|
|
|
|
|
|
|
- name: Create 'kube-system' namespace |
|
|
|
command: kubectl create -f /etc/kubernetes/kube-system-ns.yml |
|
|
|
when: kubesystem|failed |
|
|
|
changed_when: False |
|
|
|
run_once: yes |
|
|
|
|
|
|
|
- name: Write kube-controller-manager manifest |
|
|
|
template: |
|
|
|
src: manifests/kube-controller-manager.manifest.j2 |
|
|
|