From 3c1bfaee6e05d8f9755cc23e3d147fcfce4cb806 Mon Sep 17 00:00:00 2001 From: Sergey Bondarev Date: Tue, 17 Oct 2017 01:18:05 +0300 Subject: [PATCH] on initial setup node not started. add missed config for first run cni.go:196] Unable to update cni config: No networks found in /etc/cni/net.d kubelet.go:2095] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized --- roles/network_plugin/flannel/tasks/main.yml | 5 +++++ .../flannel/templates/10-flannel.conflist.j2 | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 roles/network_plugin/flannel/templates/10-flannel.conflist.j2 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 + } + } + ] +}