Fix calico etcd mode networkpolicy RBAC (#12344)

This commit is contained in:
Chad Swenson
2025-06-27 06:50:29 -05:00
committed by GitHub
parent 048967e3b0
commit ede92b0654

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: [""]