diff --git a/roles/network_plugin/flannel/tasks/main.yml b/roles/network_plugin/flannel/tasks/main.yml index 7da3bfaa4..b75cc2d64 100644 --- a/roles/network_plugin/flannel/tasks/main.yml +++ b/roles/network_plugin/flannel/tasks/main.yml @@ -8,6 +8,11 @@ register: flannel_rbac_manifest when: inventory_hostname == groups['kube-master'][0] and rbac_enabled +- name: Flannel | Create cni-flannel config + template: + src: 10-flannel.conflist.j2 + dest: "/etc/cni/net.d/10-flannel.conflist" + - name: Flannel | Create cni-flannel manifest template: src: cni-flannel.yml.j2 diff --git a/roles/network_plugin/flannel/templates/10-flannel.conflist.j2 b/roles/network_plugin/flannel/templates/10-flannel.conflist.j2 new file mode 100644 index 000000000..3cb5877ee --- /dev/null +++ b/roles/network_plugin/flannel/templates/10-flannel.conflist.j2 @@ -0,0 +1,19 @@ +{ + "name":"cbr0", + "cniVersion":"0.3.1", + "plugins":[ + { + "type":"flannel", + "delegate":{ + "forceAddress":true, + "isDefaultGateway":true + } + }, + { + "type":"portmap", + "capabilities":{ + "portMappings":true + } + } + ] +}