diff --git a/inventory/sample/group_vars/k8s_cluster/k8s-net-calico.yml b/inventory/sample/group_vars/k8s_cluster/k8s-net-calico.yml index 34bb119609610dd7cb8efae91347a148767f79a7..bcf7827d4d2b45265a2d9e748364d7b7037dfd91 100644 --- a/inventory/sample/group_vars/k8s_cluster/k8s-net-calico.yml +++ b/inventory/sample/group_vars/k8s_cluster/k8s-net-calico.yml @@ -1,5 +1,9 @@ +--- # see roles/network_plugin/calico/defaults/main.yml +# the default value of name +calico_cni_name: k8s-pod-network + ## With calico it is possible to distributed routes with border routers of the datacenter. ## Warning : enabling router peering will disable calico's default behavior ('node mesh'). ## The subnets of each nodes will be distributed by the datacenter router diff --git a/roles/network_plugin/calico/defaults/main.yml b/roles/network_plugin/calico/defaults/main.yml index ae1b65dc17407b186b4b38dc63074ac64cf8b56e..9e947ec703a856662af7daebcd7006611340bc55 100644 --- a/roles/network_plugin/calico/defaults/main.yml +++ b/roles/network_plugin/calico/defaults/main.yml @@ -1,4 +1,7 @@ --- +# the default value of name +calico_cni_name: k8s-pod-network + # Enables Internet connectivity from containers nat_outgoing: true diff --git a/roles/network_plugin/calico/templates/cni-calico.conflist.j2 b/roles/network_plugin/calico/templates/cni-calico.conflist.j2 index acac05f51ad845846b74afd157c4ed4249001bfd..13d0a23673659f2393faba0dbef50ac0ab1a7de3 100644 --- a/roles/network_plugin/calico/templates/cni-calico.conflist.j2 +++ b/roles/network_plugin/calico/templates/cni-calico.conflist.j2 @@ -1,5 +1,5 @@ { - "name": "cni0", + "name": "{{ calico_cni_name }}", "cniVersion":"0.3.1", "plugins":[ {