2017-09-04 16:29:51 +08:00
|
|
|
---
|
|
|
|
kind: ClusterRole
|
2020-01-08 18:27:40 +08:00
|
|
|
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
|
2019-04-25 20:00:48 +08:00
|
|
|
{% if calico_datastore == "etcd" %}
|
2018-08-23 00:16:13 +08:00
|
|
|
- apiGroups:
|
|
|
|
- policy
|
|
|
|
resourceNames:
|
|
|
|
- privileged
|
|
|
|
resources:
|
|
|
|
- podsecuritypolicies
|
|
|
|
verbs:
|
|
|
|
- use
|
2019-04-25 20:00:48 +08:00
|
|
|
{% elif calico_datastore == "kdd" %}
|
|
|
|
# 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
|
|
|
|
- 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:
|
|
|
|
- calico-node
|
|
|
|
verbs:
|
|
|
|
- create
|