2016-11-03 15:57:11 +00:00
|
|
|
---
|
2016-11-10 09:49:47 +00:00
|
|
|
- name: Canal | Set Flannel etcd configuration
|
|
|
|
command: |-
|
|
|
|
{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} \
|
|
|
|
set /{{ cluster_name }}/network/config \
|
|
|
|
'{ "Network": "{{ kube_pods_subnet }}", "SubnetLen": {{ kube_network_node_prefix }}, "Backend": { "Type": "{{ flannel_backend_type }}" } }'
|
|
|
|
delegate_to: "{{groups['etcd'][0]}}"
|
|
|
|
run_once: true
|
2016-11-03 15:57:11 +00:00
|
|
|
|
2016-11-08 11:13:20 +00:00
|
|
|
- name: Canal | Write canal configmap
|
|
|
|
template:
|
|
|
|
src: canal-config.yml.j2
|
|
|
|
dest: /etc/kubernetes/canal-config.yaml
|
|
|
|
|
|
|
|
- name: Canal | Write canal node configuration
|
2016-11-03 15:57:11 +00:00
|
|
|
template:
|
|
|
|
src: canal-node.yml.j2
|
|
|
|
dest: /etc/kubernetes/canal-node.yaml
|
|
|
|
|
|
|
|
- name: Canal | Copy cni plugins from hyperkube
|
|
|
|
command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /usr/bin/rsync -a /opt/cni/bin/ /cnibindir/"
|
|
|
|
register: cni_task_result
|
|
|
|
until: cni_task_result.rc == 0
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: Canal | Copy cni plugins from calico/cni
|
|
|
|
command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ calico_cni_image_repo }}:{{ calico_cni_image_tag }} sh -c 'cp -a /opt/cni/bin/* /cnibindir/'"
|
|
|
|
register: cni_task_result
|
|
|
|
until: cni_task_result.rc == 0
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
changed_when: false
|