From c2a8d543fb1ced76fbcc1b4ac5ea6cebdb9b6e22 Mon Sep 17 00:00:00 2001
From: Mohamed Omar Zaian <mohamedzaian@gmail.com>
Date: Tue, 25 Apr 2023 22:08:16 +0200
Subject: [PATCH] [flannel] update to v0.21.4 (#10027)

---
 README.md                                     |  2 +-
 roles/download/defaults/main.yml              |  2 +-
 .../flannel/templates/cni-flannel-rbac.yml.j2 | 46 +++++++++++--------
 3 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/README.md b/README.md
index 9ff446b0b..2c28abbeb 100644
--- a/README.md
+++ b/README.md
@@ -171,7 +171,7 @@ Note: Upstart/SysV init based OS types are not supported.
   - [calico](https://github.com/projectcalico/calico) v3.25.1
   - [canal](https://github.com/projectcalico/canal) (given calico/flannel versions)
   - [cilium](https://github.com/cilium/cilium) v1.13.0
-  - [flannel](https://github.com/flannel-io/flannel) v0.20.2
+  - [flannel](https://github.com/flannel-io/flannel) v0.21.4
   - [kube-ovn](https://github.com/alauda/kube-ovn) v1.10.7
   - [kube-router](https://github.com/cloudnativelabs/kube-router) v1.5.1
   - [multus](https://github.com/k8snetworkplumbingwg/multus-cni) v3.8
diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml
index 195dacb2e..a3893d789 100644
--- a/roles/download/defaults/main.yml
+++ b/roles/download/defaults/main.yml
@@ -113,7 +113,7 @@ calico_apiserver_version: "{{ calico_version }}"
 typha_enabled: false
 calico_apiserver_enabled: false
 
-flannel_version: "v0.20.2"
+flannel_version: "v0.21.4"
 flannel_cni_version: "v1.2.0"
 cni_version: "v1.2.0"
 weave_version: 2.8.1
diff --git a/roles/network_plugin/flannel/templates/cni-flannel-rbac.yml.j2 b/roles/network_plugin/flannel/templates/cni-flannel-rbac.yml.j2
index 7c73b095d..631ec5eb6 100644
--- a/roles/network_plugin/flannel/templates/cni-flannel-rbac.yml.j2
+++ b/roles/network_plugin/flannel/templates/cni-flannel-rbac.yml.j2
@@ -10,25 +10,33 @@ apiVersion: rbac.authorization.k8s.io/v1
 metadata:
   name: flannel
 rules:
-  - apiGroups:
-      - ""
-    resources:
-      - pods
-    verbs:
-      - get
-  - apiGroups:
-      - ""
-    resources:
-      - nodes
-    verbs:
-      - list
-      - watch
-  - apiGroups:
-      - ""
-    resources:
-      - nodes/status
-    verbs:
-      - patch
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  verbs:
+  - get
+- apiGroups:
+  - ""
+  resources:
+  - nodes
+  verbs:
+  - get
+  - list
+  - watch
+- apiGroups:
+  - ""
+  resources:
+  - nodes/status
+  verbs:
+  - patch
+- apiGroups:
+  - "networking.k8s.io"
+  resources:
+  - clustercidrs
+  verbs:
+  - list
+  - watch
 ---
 kind: ClusterRoleBinding
 apiVersion: rbac.authorization.k8s.io/v1
-- 
GitLab