diff --git a/inventory/group_vars/k8s-cluster.yml b/inventory/group_vars/k8s-cluster.yml index 8f79f3297..018bbe969 100644 --- a/inventory/group_vars/k8s-cluster.yml +++ b/inventory/group_vars/k8s-cluster.yml @@ -86,6 +86,9 @@ weave_mode_seed: false weave_seed: uninitialized weave_peers: uninitialized +# Set the MTU of Weave (default 1376, Jumbo Frames: 8916) +weave_mtu: 1376 + # Enable kubernetes network policies enable_network_policy: false diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml index 8872afa6a..661fb9173 100644 --- a/roles/download/defaults/main.yml +++ b/roles/download/defaults/main.yml @@ -38,7 +38,7 @@ flannel_version: "v0.9.1" flannel_cni_version: "v0.3.0" istio_version: "0.2.6" vault_version: 0.8.1 -weave_version: 2.1.3 +weave_version: 2.2.0 pod_infra_version: 3.0 contiv_version: 1.1.7 diff --git a/roles/network_plugin/weave/defaults/main.yml b/roles/network_plugin/weave/defaults/main.yml index c27e48371..27fc13a15 100644 --- a/roles/network_plugin/weave/defaults/main.yml +++ b/roles/network_plugin/weave/defaults/main.yml @@ -12,5 +12,8 @@ weave_cpu_requests: 10m weave_seed: uninitialized weave_peers: uninitialized +# Set the MTU of Weave (default 1376, Jumbo Frames: 8916) +weave_mtu: 1376 + # this variable is use in seed mode -weave_ip_current_cluster: "{% for host in groups['k8s-cluster'] %}{{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}{% if not loop.last %} {% endif %}{% endfor %}" \ No newline at end of file +weave_ip_current_cluster: "{% for host in groups['k8s-cluster'] %}{{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}{% if not loop.last %} {% endif %}{% endfor %}" diff --git a/roles/network_plugin/weave/templates/weave-net.yml.j2 b/roles/network_plugin/weave/templates/weave-net.yml.j2 index 2f8703f94..b292339b5 100644 --- a/roles/network_plugin/weave/templates/weave-net.yml.j2 +++ b/roles/network_plugin/weave/templates/weave-net.yml.j2 @@ -34,6 +34,37 @@ items: - get - list - watch + - apiGroups: + - 'networking.k8s.io' + resources: + - networkpolicies + verbs: + - get + - list + - watch + - apiVersion: rbac.authorization.k8s.io/v1beta1 + kind: Role + metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net + rules: + - apiGroups: + - '' + resources: + - configmaps + resourceNames: + - weave-net + verbs: + - get + - update + - apiGroups: + - '' + resources: + - configmaps + verbs: + - create - apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -78,6 +109,8 @@ items: fieldRef: apiVersion: v1 fieldPath: spec.nodeName + - name: WEAVE_MTU + value: "{{ weave_mtu }}" - name: IPALLOC_RANGE value: {{ kube_pods_subnet }} {% if weave_mode_seed == true %} @@ -164,4 +197,3 @@ items: rollingUpdate: maxUnavailable: {{ serial | default('20%') }} type: RollingUpdate -