2017-09-04 08:29:51 +00:00
|
|
|
---
|
|
|
|
kind: ClusterRole
|
2020-01-08 10:27:40 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2017-09-04 08:29:51 +00:00
|
|
|
metadata:
|
|
|
|
name: calico-node
|
2018-03-30 11:29:13 +00:00
|
|
|
namespace: kube-system
|
2017-09-04 08:29:51 +00:00
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- pods
|
|
|
|
- nodes
|
2019-01-28 19:03:49 +00:00
|
|
|
- namespaces
|
2020-04-09 14:27:43 +00:00
|
|
|
- configmaps
|
2017-09-04 08:29:51 +00:00
|
|
|
verbs:
|
|
|
|
- get
|
2019-01-28 19:03:49 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- endpoints
|
|
|
|
- services
|
|
|
|
verbs:
|
|
|
|
- watch
|
|
|
|
- list
|
2019-04-25 12:00:48 +00:00
|
|
|
{% if calico_datastore == "kdd" %}
|
|
|
|
# Used to discover Typhas.
|
|
|
|
- get
|
|
|
|
{% endif %}
|
2019-01-28 19:03:49 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- nodes/status
|
|
|
|
verbs:
|
2021-06-07 11:58:39 +00:00
|
|
|
# Needed for clearing NodeNetworkUnavailable flag.
|
2019-01-28 19:03:49 +00:00
|
|
|
- patch
|
2019-04-25 12:00:48 +00:00
|
|
|
{% if calico_datastore == "etcd" %}
|
2018-08-22 16:16:13 +00:00
|
|
|
- apiGroups:
|
|
|
|
- policy
|
|
|
|
resourceNames:
|
|
|
|
- privileged
|
|
|
|
resources:
|
|
|
|
- podsecuritypolicies
|
|
|
|
verbs:
|
|
|
|
- use
|
2019-04-25 12:00:48 +00: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
|
2019-07-09 19:42:28 +00:00
|
|
|
- ipamblocks
|
2019-04-25 12:00:48 +00:00
|
|
|
- globalnetworkpolicies
|
|
|
|
- globalnetworksets
|
|
|
|
- networkpolicies
|
2019-07-09 19:42:28 +00:00
|
|
|
- networksets
|
2019-04-25 12:00:48 +00:00
|
|
|
- clusterinformations
|
|
|
|
- hostendpoints
|
2020-01-08 10:27:40 +00:00
|
|
|
- blockaffinities
|
2019-04-25 12:00:48 +00: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
|
|
|
|
# Calico stores some configuration information on the node.
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources:
|
|
|
|
- nodes
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
2019-09-26 11:25:08 +00:00
|
|
|
# These permissions are only required for upgrade from v2.6, and can
|
2019-04-25 12:00:48 +00:00
|
|
|
# be removed after upgrade or on fresh installations.
|
|
|
|
- apiGroups: ["crd.projectcalico.org"]
|
|
|
|
resources:
|
|
|
|
- bgpconfigurations
|
|
|
|
- bgppeers
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- update
|
2019-07-09 19:42:28 +00: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
|
|
|
|
# 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
|
|
|
|
{% endif %}
|