diff --git a/roles/network_plugin/weave/tasks/main.yml b/roles/network_plugin/weave/tasks/main.yml index 30c209f8b..d843e4545 100644 --- a/roles/network_plugin/weave/tasks/main.yml +++ b/roles/network_plugin/weave/tasks/main.yml @@ -2,6 +2,13 @@ - include: seed.yml when: weave_mode_seed + +- name: template weavenet conflist + template: + src: weavenet.conflist.j2 + dest: /etc/cni/net.d/00-weave.conflist + owner: kube + - name: Weave | Copy cni plugins from hyperkube command: "{{ docker_bin_dir }}/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/" register: cni_task_result diff --git a/roles/network_plugin/weave/templates/weavenet.conflist.j2 b/roles/network_plugin/weave/templates/weavenet.conflist.j2 new file mode 100644 index 000000000..45ae0b967 --- /dev/null +++ b/roles/network_plugin/weave/templates/weavenet.conflist.j2 @@ -0,0 +1,16 @@ +{ + "cniVersion": "0.3.0", + "name": "mynet", + "plugins": [ + { + "name": "weave", + "type": "weave-net", + "hairpinMode": true + }, + { + "type": "portmap", + "capabilities": {"portMappings": true}, + "snat": true + } + ] +}