Fix calico etcd mode networkpolicy RBAC (#12753)

Co-authored-by: Chad Swenson <chadswen@gmail.com>
This commit is contained in:
k8s-infra-cherrypick-robot
2025-11-28 08:36:21 -08:00
committed by GitHub
parent 7a27aef736
commit 17d21676e9

View File

@@ -6,19 +6,26 @@ metadata:
namespace: kube-system namespace: kube-system
rules: rules:
{% if calico_datastore == "etcd" %} {% if calico_datastore == "etcd" %}
- apiGroups: # Pods are monitored for changing labels.
- "" # The node controller monitors Kubernetes nodes.
- extensions # Namespace and serviceaccount labels are used for policy.
- apiGroups: [""]
resources: resources:
- pods - pods
- namespaces
- networkpolicies
- nodes - nodes
- namespaces
- serviceaccounts - serviceaccounts
verbs: verbs:
- watch - watch
- list - list
- get - get
# Watch for changes to Kubernetes NetworkPolicies.
- apiGroups: ["networking.k8s.io"]
resources:
- networkpolicies
verbs:
- watch
- list
{% elif calico_datastore == "kdd" %} {% elif calico_datastore == "kdd" %}
# Nodes are watched to monitor for deletions. # Nodes are watched to monitor for deletions.
- apiGroups: [""] - apiGroups: [""]