2018-02-17 11:37:47 +08:00
|
|
|
---
|
2018-07-27 04:17:27 +08:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2018-02-17 11:37:47 +08:00
|
|
|
kind: ClusterRole
|
2019-08-06 16:37:55 +08: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
|
2022-07-27 01:33:11 +08:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- nodes
|
|
|
|
verbs:
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
# To remove node taints
|
|
|
|
- nodes
|
|
|
|
# To set NetworkUnavailable false on startup
|
|
|
|
- nodes/status
|
|
|
|
verbs:
|
|
|
|
- patch
|
2020-04-11 14:47:48 +08:00
|
|
|
- apiGroups:
|
|
|
|
- discovery.k8s.io
|
|
|
|
resources:
|
|
|
|
- endpointslices
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
2022-09-19 17:14:31 +08:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- services
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
2022-05-11 21:23:04 +08:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
# to perform LB IP allocation for BGP
|
|
|
|
- services/status
|
|
|
|
verbs:
|
|
|
|
- update
|
2023-04-10 13:07:15 +08:00
|
|
|
- patch
|
2019-08-06 16:37:55 +08:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
# to perform the translation of a CNP that contains `ToGroup` to its endpoints
|
|
|
|
- services
|
|
|
|
- endpoints
|
2020-04-11 14:47:48 +08:00
|
|
|
# to check apiserver connectivity
|
|
|
|
- namespaces
|
2019-08-06 16:37:55 +08:00
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- apiGroups:
|
|
|
|
- cilium.io
|
|
|
|
resources:
|
|
|
|
- ciliumnetworkpolicies
|
|
|
|
- ciliumnetworkpolicies/status
|
2022-09-19 17:14:31 +08:00
|
|
|
- ciliumnetworkpolicies/finalizers
|
2020-04-11 14:47:48 +08:00
|
|
|
- ciliumclusterwidenetworkpolicies
|
|
|
|
- ciliumclusterwidenetworkpolicies/status
|
2022-09-19 17:14:31 +08:00
|
|
|
- ciliumclusterwidenetworkpolicies/finalizers
|
2019-08-06 16:37:55 +08:00
|
|
|
- ciliumendpoints
|
|
|
|
- ciliumendpoints/status
|
2022-09-19 17:14:31 +08:00
|
|
|
- ciliumendpoints/finalizers
|
2020-03-11 23:15:36 +08:00
|
|
|
- ciliumnodes
|
|
|
|
- ciliumnodes/status
|
2022-09-19 17:14:31 +08:00
|
|
|
- ciliumnodes/finalizers
|
2020-03-11 23:15:36 +08:00
|
|
|
- ciliumidentities
|
|
|
|
- ciliumidentities/status
|
2021-04-30 23:09:59 +08:00
|
|
|
- ciliumidentities/finalizers
|
|
|
|
- ciliumlocalredirectpolicies
|
|
|
|
- ciliumlocalredirectpolicies/status
|
|
|
|
- ciliumlocalredirectpolicies/finalizers
|
2022-05-11 21:23:04 +08:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.11', '>=') %}
|
|
|
|
- ciliumendpointslices
|
|
|
|
{% endif %}
|
|
|
|
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
|
|
|
- ciliumbgploadbalancerippools
|
2023-04-10 13:07:15 +08:00
|
|
|
- ciliumloadbalancerippools
|
|
|
|
- ciliumloadbalancerippools/status
|
2022-05-11 21:23:04 +08:00
|
|
|
- ciliumbgppeeringpolicies
|
|
|
|
- ciliumenvoyconfigs
|
2020-04-24 21:00:10 +08:00
|
|
|
{% endif %}
|
2019-08-06 16:37:55 +08:00
|
|
|
verbs:
|
2022-09-19 17:14:31 +08:00
|
|
|
- '*'
|
2020-06-25 21:16:38 +08:00
|
|
|
- apiGroups:
|
|
|
|
- apiextensions.k8s.io
|
|
|
|
resources:
|
|
|
|
- customresourcedefinitions
|
|
|
|
verbs:
|
2021-03-29 15:04:51 +08:00
|
|
|
- create
|
2020-06-25 21:16:38 +08:00
|
|
|
- get
|
|
|
|
- list
|
2021-03-29 15:04:51 +08:00
|
|
|
- update
|
2020-06-25 21:16:38 +08:00
|
|
|
- watch
|
2022-09-19 17:14:31 +08:00
|
|
|
# For cilium-operator running in HA mode.
|
|
|
|
#
|
|
|
|
# Cilium operator running in HA mode requires the use of ResourceLock for Leader Election
|
|
|
|
# between multiple 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".
|
2020-09-18 17:12:45 +08:00
|
|
|
- apiGroups:
|
|
|
|
- coordination.k8s.io
|
|
|
|
resources:
|
|
|
|
- leases
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- get
|
|
|
|
- update
|
2022-09-19 17:14:31 +08:00
|
|
|
{% if cilium_version | regex_replace('v') is version('1.12', '>=') %}
|
|
|
|
- apiGroups:
|
|
|
|
- apiextensions.k8s.io
|
|
|
|
resources:
|
|
|
|
- customresourcedefinitions
|
|
|
|
verbs:
|
|
|
|
- update
|
|
|
|
resourceNames:
|
|
|
|
- ciliumbgploadbalancerippools.cilium.io
|
|
|
|
- ciliumbgppeeringpolicies.cilium.io
|
|
|
|
- ciliumclusterwideenvoyconfigs.cilium.io
|
|
|
|
- ciliumclusterwidenetworkpolicies.cilium.io
|
|
|
|
- ciliumegressgatewaypolicies.cilium.io
|
|
|
|
- ciliumegressnatpolicies.cilium.io
|
|
|
|
- ciliumendpoints.cilium.io
|
|
|
|
- ciliumendpointslices.cilium.io
|
|
|
|
- ciliumenvoyconfigs.cilium.io
|
|
|
|
- ciliumexternalworkloads.cilium.io
|
|
|
|
- ciliumidentities.cilium.io
|
|
|
|
- ciliumlocalredirectpolicies.cilium.io
|
|
|
|
- ciliumnetworkpolicies.cilium.io
|
|
|
|
- ciliumnodes.cilium.io
|
2020-09-18 17:12:45 +08:00
|
|
|
{% endif %}
|
2023-07-03 17:20:51 +08:00
|
|
|
{% for rules in cilium_clusterrole_rules_operator_extra_vars %}
|
|
|
|
- apiGroups:
|
|
|
|
{% for api in rules['apiGroups'] %}
|
|
|
|
- {{ api }}
|
|
|
|
{% endfor %}
|
|
|
|
resources:
|
|
|
|
{% for resource in rules['resources'] %}
|
|
|
|
- {{ resource }}
|
|
|
|
{% endfor %}
|
|
|
|
verbs:
|
|
|
|
{% for verb in rules['verbs'] %}
|
|
|
|
- {{ verb }}
|
|
|
|
{% endfor %}
|
|
|
|
{% if 'resourceNames' in rules %}
|
|
|
|
resourceNames:
|
|
|
|
{% for resourceName in rules['resourceNames'] %}
|
|
|
|
- {{ resourceName }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|