2017-08-24 17:09:52 +08:00
|
|
|
---
|
2017-09-04 16:29:40 +08:00
|
|
|
- name: Set cert dir
|
|
|
|
set_fact:
|
2016-12-30 20:47:12 +08:00
|
|
|
calico_cert_dir: "{{ canal_cert_dir }}"
|
2018-08-23 22:17:18 +08:00
|
|
|
when:
|
|
|
|
- kube_network_plugin == 'canal'
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- facts
|
|
|
|
- canal
|
2016-12-30 20:47:12 +08:00
|
|
|
|
2017-11-28 20:01:30 +08:00
|
|
|
- name: Create calico-kube-controllers manifests
|
2017-02-18 05:22:34 +08:00
|
|
|
template:
|
2019-05-03 05:24:21 +08:00
|
|
|
src: "{{ item.file }}.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/{{ item.file }}"
|
2022-01-09 17:51:12 +08:00
|
|
|
mode: 0644
|
2017-09-04 16:29:40 +08:00
|
|
|
with_items:
|
2017-11-28 20:01:30 +08:00
|
|
|
- {name: calico-kube-controllers, file: calico-kube-controllers.yml, type: deployment}
|
|
|
|
- {name: calico-kube-controllers, file: calico-kube-sa.yml, type: sa}
|
|
|
|
- {name: calico-kube-controllers, file: calico-kube-cr.yml, type: clusterrole}
|
|
|
|
- {name: calico-kube-controllers, file: calico-kube-crb.yml, type: clusterrolebinding}
|
|
|
|
register: calico_kube_manifests
|
2018-08-23 22:17:18 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-08-23 22:17:18 +08:00
|
|
|
- rbac_enabled or item.type not in rbac_resources
|
2016-10-10 22:09:50 +08:00
|
|
|
|
2017-11-28 20:01:30 +08:00
|
|
|
- name: Start of Calico kube controllers
|
2016-10-10 22:09:50 +08:00
|
|
|
kube:
|
2019-05-03 05:24:21 +08:00
|
|
|
name: "{{ item.item.name }}"
|
2018-03-30 19:29:13 +08:00
|
|
|
namespace: "kube-system"
|
2019-05-03 05:24:21 +08:00
|
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
|
|
|
resource: "{{ item.item.type }}"
|
|
|
|
filename: "{{ kube_config_dir }}/{{ item.item.file }}"
|
2017-09-05 13:23:12 +08:00
|
|
|
state: "latest"
|
2019-04-24 01:37:23 +08:00
|
|
|
with_items:
|
|
|
|
- "{{ calico_kube_manifests.results }}"
|
2022-11-02 15:18:45 +08:00
|
|
|
register: calico_kube_controller_start
|
|
|
|
until: calico_kube_controller_start is succeeded
|
|
|
|
retries: 4
|
2018-08-23 22:17:18 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2019-04-24 01:37:23 +08:00
|
|
|
- not item is skipped
|
|
|
|
loop_control:
|
2019-04-24 03:06:03 +08:00
|
|
|
label: "{{ item.item.file }}"
|