mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-10 12:18:52 +03:00
Change calicoctl deployment to use container
Improves upgradability of calicoctl by leveraging docker tags.
This commit is contained in:
@@ -19,10 +19,15 @@
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: Calico | Install calicoctl bin
|
||||
command: rsync -piu "{{ local_release_dir }}/calico/bin/calicoctl" "{{ bin_dir }}/calicoctl"
|
||||
register: calico_copy
|
||||
- name: Calico | Install calicoctl container script
|
||||
template:
|
||||
src: calicoctl-container.j2
|
||||
dest: "{{ bin_dir }}/calicoctl"
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
changed_when: false
|
||||
notify: restart calico-node
|
||||
|
||||
- name: Calico | Install calico cni bin
|
||||
command: rsync -piu "{{ local_release_dir }}/calico/bin/calico" "/opt/cni/bin/calico"
|
||||
@@ -32,9 +37,6 @@
|
||||
command: rsync -piu "{{ local_release_dir }}/calico/bin/calico" "/opt/cni/bin/calico-ipam"
|
||||
changed_when: false
|
||||
|
||||
- name: Calico | install calicoctl
|
||||
file: path={{ bin_dir }}/calicoctl mode=0755 state=file
|
||||
|
||||
- name: Calico | wait for etcd
|
||||
wait_for:
|
||||
port: 2379
|
||||
@@ -108,21 +110,12 @@
|
||||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: Calico | Restart calico if binary changed
|
||||
service:
|
||||
name: calico-node
|
||||
state: restarted
|
||||
when: calico_copy.stdout_lines
|
||||
|
||||
- name: Calico | Disable node mesh
|
||||
shell: "{{ bin_dir }}/calicoctl bgp node-mesh off"
|
||||
environment:
|
||||
ETCD_AUTHORITY: "127.0.0.1:2379"
|
||||
when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
|
||||
|
||||
- name: Calico | Configure peering with router(s)
|
||||
shell: "{{ bin_dir }}/calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}"
|
||||
environment:
|
||||
ETCD_AUTHORITY: "127.0.0.1:2379"
|
||||
with_items: peers
|
||||
when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user