2022-12-15 14:27:57 +00:00
|
|
|
{{- if .Values.snapshotController.enabled }}
|
2022-01-11 13:25:46 +00:00
|
|
|
# RBAC file for the snapshot controller.
|
|
|
|
#
|
|
|
|
# The snapshot controller implements the control loop for CSI snapshot functionality.
|
|
|
|
# It should be installed as part of the base Kubernetes distribution in an appropriate
|
|
|
|
# namespace for components implementing base system functionality. For installing with
|
|
|
|
# Vanilla Kubernetes, kube-system makes sense for the namespace.
|
|
|
|
|
2024-03-27 22:48:02 +00:00
|
|
|
---
|
2022-01-11 13:25:46 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: snapshot-controller
|
|
|
|
namespace: kube-system
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: ClusterRole
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: snapshot-controller-runner
|
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumes"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumeclaims"]
|
|
|
|
verbs: ["get", "list", "watch", "update"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["events"]
|
|
|
|
verbs: ["list", "watch", "create", "update", "patch"]
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotclasses"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotcontents"]
|
2023-05-04 17:00:09 +00:00
|
|
|
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotcontents/status"]
|
|
|
|
verbs: ["patch"]
|
2022-01-11 13:25:46 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots"]
|
2024-03-27 22:48:02 +00:00
|
|
|
verbs: ["get", "list", "watch", "update", "patch", "delete"]
|
2022-01-11 13:25:46 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots/status"]
|
2023-05-04 17:00:09 +00:00
|
|
|
verbs: ["update", "patch"]
|
2024-03-27 22:48:02 +00:00
|
|
|
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshotclasses"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshotcontents"]
|
|
|
|
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshotcontents/status"]
|
|
|
|
verbs: ["patch"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshots"]
|
|
|
|
verbs: ["get", "list", "watch", "update", "patch"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshots/status"]
|
|
|
|
verbs: ["update", "patch"]
|
|
|
|
|
2023-05-04 17:00:09 +00:00
|
|
|
# Enable this RBAC rule only when using distributed snapshotting, i.e. when the enable-distributed-snapshotting flag is set to true
|
|
|
|
# - apiGroups: [""]
|
|
|
|
# resources: ["nodes"]
|
|
|
|
# verbs: ["get", "list", "watch"]
|
2022-01-11 13:25:46 +00:00
|
|
|
---
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: snapshot-controller-role
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: snapshot-controller
|
|
|
|
namespace: kube-system
|
|
|
|
roleRef:
|
|
|
|
kind: ClusterRole
|
|
|
|
name: snapshot-controller-runner
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: Role
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: snapshot-controller-leaderelection
|
2024-03-27 22:48:02 +00:00
|
|
|
namespace: kube-system
|
2022-01-11 13:25:46 +00:00
|
|
|
rules:
|
|
|
|
- apiGroups: ["coordination.k8s.io"]
|
|
|
|
resources: ["leases"]
|
|
|
|
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: RoleBinding
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: snapshot-controller-leaderelection
|
|
|
|
namespace: kube-system
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: snapshot-controller
|
|
|
|
roleRef:
|
|
|
|
kind: Role
|
|
|
|
name: snapshot-controller-leaderelection
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
2022-12-15 14:27:57 +00:00
|
|
|
{{- end }}
|