2017-09-04 16:29:51 +08:00
|
|
|
---
|
|
|
|
kind: ClusterRole
|
2020-01-08 18:27:40 +08:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2023-09-19 17:49:06 +08:00
|
|
|
metadata:
|
|
|
|
name: calico-cni-plugin
|
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- pods
|
|
|
|
- nodes
|
|
|
|
- namespaces
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- pods/status
|
|
|
|
verbs:
|
|
|
|
- patch
|
2024-04-23 01:09:37 +08:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- nodes/status
|
|
|
|
verbs:
|
|
|
|
- update
|
2023-09-19 17:49:06 +08:00
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- blockaffinities
|
|
|
|
- ipamblocks
|
|
|
|
- ipamhandles
|
|
|
|
- clusterinformations
|
|
|
|
- ippools
|
|
|
|
- ipreservations
|
|
|
|
- ipamconfigs
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- create
|
|
|
|
- update
|
|
|
|
- delete
|
|
|
|
---
|
|
|
|
kind: ClusterRole
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2017-09-04 16:29:51 +08:00
|
|
|
metadata:
|
|
|
|
name: calico-node
|
2018-03-30 19:29:13 +08:00
|
|
|
namespace: kube-system
|
2017-09-04 16:29:51 +08:00
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- pods
|
|
|
|
- nodes
|
2019-01-29 03:03:49 +08:00
|
|
|
- namespaces
|
2020-04-09 22:27:43 +08:00
|
|
|
- configmaps
|
2017-09-04 16:29:51 +08:00
|
|
|
verbs:
|
|
|
|
- get
|
2021-08-26 03:06:01 +08:00
|
|
|
# EndpointSlices are used for Service-based network policy rule
|
|
|
|
# enforcement.
|
|
|
|
- apiGroups: ["discovery.k8s.io"]
|
|
|
|
resources:
|
|
|
|
- endpointslices
|
|
|
|
verbs:
|
|
|
|
- watch
|
|
|
|
- list
|
2019-01-29 03:03:49 +08:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- endpoints
|
|
|
|
- services
|
|
|
|
verbs:
|
|
|
|
- watch
|
|
|
|
- list
|
2019-04-25 20:00:48 +08:00
|
|
|
{% if calico_datastore == "kdd" %}
|
|
|
|
# Used to discover Typhas.
|
|
|
|
- get
|
|
|
|
{% endif %}
|
2019-01-29 03:03:49 +08:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- nodes/status
|
|
|
|
verbs:
|
2021-06-07 19:58:39 +08:00
|
|
|
# Needed for clearing NodeNetworkUnavailable flag.
|
2019-01-29 03:03:49 +08:00
|
|
|
- patch
|
2023-12-18 21:13:43 +08:00
|
|
|
{% if calico_datastore == "kdd" %}
|
2019-04-25 20:00:48 +08:00
|
|
|
# Calico stores some configuration information in node annotations.
|
|
|
|
- update
|
|
|
|
# Watch for changes to Kubernetes NetworkPolicies.
|
|
|
|
- apiGroups: ["networking.k8s.io"]
|
|
|
|
resources:
|
|
|
|
- networkpolicies
|
|
|
|
verbs:
|
|
|
|
- watch
|
|
|
|
- list
|
|
|
|
# Used by Calico for policy information.
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- pods
|
|
|
|
- namespaces
|
|
|
|
- serviceaccounts
|
|
|
|
verbs:
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
# The CNI plugin patches pods/status.
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- pods/status
|
|
|
|
verbs:
|
|
|
|
- patch
|
|
|
|
# Calico monitors various CRDs for config.
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- globalfelixconfigs
|
|
|
|
- felixconfigurations
|
|
|
|
- bgppeers
|
2023-09-19 17:49:06 +08:00
|
|
|
- bgpfilters
|
2019-04-25 20:00:48 +08:00
|
|
|
- globalbgpconfigs
|
|
|
|
- bgpconfigurations
|
|
|
|
- ippools
|
2021-12-02 17:17:33 +08:00
|
|
|
- ipreservations
|
2019-07-10 03:42:28 +08:00
|
|
|
- ipamblocks
|
2019-04-25 20:00:48 +08:00
|
|
|
- globalnetworkpolicies
|
|
|
|
- globalnetworksets
|
|
|
|
- networkpolicies
|
2019-07-10 03:42:28 +08:00
|
|
|
- networksets
|
2019-04-25 20:00:48 +08:00
|
|
|
- clusterinformations
|
|
|
|
- hostendpoints
|
2020-01-08 18:27:40 +08:00
|
|
|
- blockaffinities
|
2021-12-02 17:17:33 +08:00
|
|
|
- caliconodestatuses
|
2019-04-25 20:00:48 +08:00
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
# Calico must create and update some CRDs on startup.
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- ippools
|
|
|
|
- felixconfigurations
|
|
|
|
- clusterinformations
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- update
|
2021-12-02 17:17:33 +08:00
|
|
|
# Calico must update some CRDs.
|
|
|
|
- apiGroups: [ "crd.projectcalico.org" ]
|
|
|
|
resources:
|
|
|
|
- caliconodestatuses
|
|
|
|
verbs:
|
|
|
|
- update
|
2019-04-25 20:00:48 +08:00
|
|
|
# Calico stores some configuration information on the node.
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- nodes
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
2019-09-26 19:25:08 +08:00
|
|
|
# These permissions are only required for upgrade from v2.6, and can
|
2019-04-25 20:00:48 +08:00
|
|
|
# be removed after upgrade or on fresh installations.
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- bgpconfigurations
|
|
|
|
- bgppeers
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- update
|
2019-07-10 03:42:28 +08:00
|
|
|
# These permissions are required for Calico CNI to perform IPAM allocations.
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- blockaffinities
|
|
|
|
- ipamblocks
|
|
|
|
- ipamhandles
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- create
|
|
|
|
- update
|
|
|
|
- delete
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- ipamconfigs
|
|
|
|
verbs:
|
|
|
|
- get
|
2023-02-20 17:43:40 +08:00
|
|
|
- create
|
2019-07-10 03:42:28 +08:00
|
|
|
# Block affinities must also be watchable by confd for route aggregation.
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- blockaffinities
|
|
|
|
verbs:
|
|
|
|
- watch
|
|
|
|
# The Calico IPAM migration needs to get daemonsets. These permissions can be
|
|
|
|
# removed if not upgrading from an installation using host-local IPAM.
|
|
|
|
- apiGroups: ["apps"]
|
|
|
|
resources:
|
|
|
|
- daemonsets
|
|
|
|
verbs:
|
|
|
|
- get
|
2022-08-30 13:41:00 +08:00
|
|
|
{% endif %}
|
2022-07-09 01:41:48 +08:00
|
|
|
# Used for creating service account tokens to be used by the CNI plugin
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- serviceaccounts/token
|
|
|
|
resourceNames:
|
2023-09-19 17:49:06 +08:00
|
|
|
- calico-cni-plugin
|
2022-07-09 01:41:48 +08:00
|
|
|
verbs:
|
|
|
|
- create
|