2018-02-17 03:37:47 +00:00
|
|
|
---
|
2018-07-26 20:17:27 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2018-02-17 03:37:47 +00:00
|
|
|
kind: ClusterRole
|
2019-08-06 08:37:55 +00:00
|
|
|
metadata:
|
|
|
|
name: cilium-operator
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
# to automatically delete [core|kube]dns pods so that are starting to being
|
|
|
|
# managed by Cilium
|
|
|
|
- pods
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- delete
|
2020-04-11 06:47:48 +00:00
|
|
|
- apiGroups:
|
|
|
|
- discovery.k8s.io
|
|
|
|
resources:
|
|
|
|
- endpointslices
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
2022-05-11 13:23:04 +00:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.10', '>=') %}
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
# to perform LB IP allocation for BGP
|
|
|
|
- services/status
|
|
|
|
verbs:
|
|
|
|
- update
|
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
2020-06-25 13:16:38 +00:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.8', '<') %}
|
2019-08-06 08:37:55 +00:00
|
|
|
# to automatically read from k8s and import the node's pod CIDR to cilium's
|
|
|
|
# etcd so all nodes know how to reach another pod running in in a different
|
|
|
|
# node.
|
|
|
|
- nodes
|
2020-06-25 13:16:38 +00:00
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
# to perform the translation of a CNP that contains `ToGroup` to its endpoints
|
|
|
|
- services
|
|
|
|
- endpoints
|
2020-04-11 06:47:48 +00:00
|
|
|
# to check apiserver connectivity
|
|
|
|
- namespaces
|
2020-04-24 13:00:10 +00:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.7', '<') %}
|
|
|
|
- componentstatuses
|
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- apiGroups:
|
|
|
|
- cilium.io
|
|
|
|
resources:
|
|
|
|
- ciliumnetworkpolicies
|
|
|
|
- ciliumnetworkpolicies/status
|
2020-04-11 06:47:48 +00:00
|
|
|
- ciliumclusterwidenetworkpolicies
|
|
|
|
- ciliumclusterwidenetworkpolicies/status
|
2019-08-06 08:37:55 +00:00
|
|
|
- ciliumendpoints
|
|
|
|
- ciliumendpoints/status
|
2020-04-24 13:00:10 +00:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.6', '>=') %}
|
2020-03-11 15:15:36 +00:00
|
|
|
- ciliumnodes
|
|
|
|
- ciliumnodes/status
|
|
|
|
- ciliumidentities
|
|
|
|
- ciliumidentities/status
|
2021-04-30 15:09:59 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if cilium_version | regex_replace('v') is version('1.9', '>=') %}
|
|
|
|
- ciliumnetworkpolicies/finalizers
|
|
|
|
- ciliumclusterwidenetworkpolicies/finalizers
|
|
|
|
- ciliumendpoints/finalizers
|
|
|
|
- ciliumnodes/finalizers
|
|
|
|
- ciliumidentities/finalizers
|
|
|
|
- ciliumlocalredirectpolicies
|
|
|
|
- ciliumlocalredirectpolicies/status
|
|
|
|
- ciliumlocalredirectpolicies/finalizers
|
2022-05-11 13:23:04 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
|
|
|
|
- ciliumendpointslices
|
|
|
|
{% endif %}
|
|
|
|
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
|
|
|
- ciliumbgploadbalancerippools
|
|
|
|
- ciliumbgppeeringpolicies
|
|
|
|
- ciliumenvoyconfigs
|
2020-04-24 13:00:10 +00:00
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
verbs:
|
2022-05-11 13:23:04 +00:00
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- create
|
|
|
|
- update
|
|
|
|
- delete
|
2020-06-25 13:16:38 +00:00
|
|
|
- apiGroups:
|
|
|
|
- apiextensions.k8s.io
|
|
|
|
resources:
|
|
|
|
- customresourcedefinitions
|
|
|
|
verbs:
|
2021-03-29 07:04:51 +00:00
|
|
|
- create
|
2020-06-25 13:16:38 +00:00
|
|
|
- get
|
|
|
|
- list
|
2021-03-29 07:04:51 +00:00
|
|
|
- update
|
2020-06-25 13:16:38 +00:00
|
|
|
- watch
|
2020-09-18 09:12:45 +00:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.8', '>=') %}
|
|
|
|
# For cilium-operator running in HA mode.
|
|
|
|
#
|
|
|
|
# Cilium operator running in HA mode requires the use of ResourceLock for Leader Election
|
|
|
|
# between mulitple running instances.
|
|
|
|
# The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less
|
|
|
|
# common and fewer objects in the cluster watch "all Leases".
|
|
|
|
# The support for leases was introduced in coordination.k8s.io/v1 during Kubernetes 1.14 release.
|
|
|
|
# In Cilium we currently don't support HA mode for K8s version < 1.14. This condition make sure
|
|
|
|
# that we only authorize access to leases resources in supported K8s versions.
|
|
|
|
- apiGroups:
|
|
|
|
- coordination.k8s.io
|
|
|
|
resources:
|
|
|
|
- leases
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- get
|
|
|
|
- update
|
|
|
|
{% endif %}
|