# Source: cilium/templates/cilium-agent-clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cilium
rules:
- resources:
  - networkpolicies
  apiGroups:
  - networking.k8s.io
  verbs:
  - get
  - list
  - watch
- resources:
  - endpointslices
  apiGroups:
  - discovery.k8s.io
  verbs:
  - get
  - list
  - watch
- resources:
  - namespaces
  - services
  - nodes
  - endpoints
  apiGroups:
  - ""
  verbs:
  - get
  - list
  - watch
- resources:
  - pods
  - pods/finalizers
  apiGroups:
  - ""
  verbs:
  - get
  - list
  - watch
  - update
  - delete
- resources:
  - nodes
  apiGroups:
  - ""
  verbs:
  - get
  - list
  - watch
  - update
- resources:
  - nodes
  - nodes/status
  apiGroups:
  - ""
  verbs:
  - patch
- resources:
  - customresourcedefinitions
  apiGroups:
  - apiextensions.k8s.io
  verbs:
  # Deprecated for removal in v1.10
  - create
  - list
  - watch
  - update
  # This is used when validating policies in preflight. This will need to stay
  # until we figure out how to avoid "get" inside the preflight, and then
  # should be removed ideally.
  - get
- resources:
  - ciliumnetworkpolicies
  - ciliumnetworkpolicies/status
  - ciliumnetworkpolicies/finalizers
  - ciliumclusterwidenetworkpolicies
  - ciliumclusterwidenetworkpolicies/status
  - ciliumclusterwidenetworkpolicies/finalizers
  - ciliumendpoints
  - ciliumendpoints/status
  - ciliumendpoints/finalizers
  - ciliumnodes
  - ciliumnodes/status
  - ciliumnodes/finalizers
  - ciliumidentities
  - ciliumidentities/finalizers
  - ciliumlocalredirectpolicies
  - ciliumlocalredirectpolicies/status
  - ciliumlocalredirectpolicies/finalizers
  - ciliumegressnatpolicies
  apiGroups:
  - cilium.io
  verbs:
  - '*'
