From cb6da09a446b62abda63e5e17ac57ac290572135 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Wed, 13 Aug 2025 15:27:57 -0600 Subject: [PATCH] security: configure sccs for the csi operator The CSI operator requires the SecurityContextConstraints to be configured for the service accounts that have a different name from the previous CSI driver, both via the manifest install and the helm install. Signed-off-by: Travis Nielsen --- .../templates/securityContextConstraints.yaml | 13 +++++++++++-- deploy/examples/operator-openshift.yaml | 8 ++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/deploy/charts/rook-ceph/templates/securityContextConstraints.yaml b/deploy/charts/rook-ceph/templates/securityContextConstraints.yaml index 44451e851..e84ce8934 100644 --- a/deploy/charts/rook-ceph/templates/securityContextConstraints.yaml +++ b/deploy/charts/rook-ceph/templates/securityContextConstraints.yaml @@ -41,7 +41,7 @@ users: - system:serviceaccount:{{ .Release.Namespace }}:rook-ceph-default - system:serviceaccount:{{ .Release.Namespace }}:rook-ceph-mgr - system:serviceaccount:{{ .Release.Namespace }}:rook-ceph-osd - - system:serviceaccount:{{ .Release.Namespace }}:rook-ceph-rgw + - system:serviceaccount:{{ .Release.Namespace }}:rook-ceph-rgw --- # scc for the CSI driver kind: SecurityContextConstraints @@ -80,12 +80,21 @@ volumes: - hostPath - projected users: - # A user needs to be added for each rook service account. + # A user needs to be added for each csi service account. +{{- if .Values.csi.rookUseCsiOperator }} + - system:serviceaccount:{{ .Release.Namespace }}:ceph-csi-cephfs-ctrlplugin-sa + - system:serviceaccount:{{ .Release.Namespace }}:ceph-csi-cephfs-nodeplugin-sa + - system:serviceaccount:{{ .Release.Namespace }}:ceph-csi-nfs-ctrlplugin-sa + - system:serviceaccount:{{ .Release.Namespace }}:ceph-csi-nfs-nodeplugin-sa + - system:serviceaccount:{{ .Release.Namespace }}:ceph-csi-rbd-ctrlplugin-sa + - system:serviceaccount:{{ .Release.Namespace }}:ceph-csi-rbd-nodeplugin-sa +{{- else }} - system:serviceaccount:{{ .Release.Namespace }}:rook-csi-rbd-plugin-sa - system:serviceaccount:{{ .Release.Namespace }}:rook-csi-rbd-provisioner-sa - system:serviceaccount:{{ .Release.Namespace }}:rook-csi-cephfs-plugin-sa - system:serviceaccount:{{ .Release.Namespace }}:rook-csi-cephfs-provisioner-sa - system:serviceaccount:{{ .Release.Namespace }}:rook-csi-nfs-plugin-sa - system:serviceaccount:{{ .Release.Namespace }}:rook-csi-nfs-provisioner-sa +{{- end }} --- {{- end }} diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml index d8324fe86..86b76e476 100644 --- a/deploy/examples/operator-openshift.yaml +++ b/deploy/examples/operator-openshift.yaml @@ -90,12 +90,20 @@ users: # A user needs to be added for each rook service account. # This assumes running in the default sample "rook-ceph" namespace. # If other namespaces or service accounts are configured, they need to be updated here. + # Service accounts for the cephcsi driver (pre-cephcsi operator) - system:serviceaccount:rook-ceph:rook-csi-rbd-plugin-sa # serviceaccount:namespace:operator - system:serviceaccount:rook-ceph:rook-csi-rbd-provisioner-sa # serviceaccount:namespace:operator - system:serviceaccount:rook-ceph:rook-csi-cephfs-plugin-sa # serviceaccount:namespace:operator - system:serviceaccount:rook-ceph:rook-csi-cephfs-provisioner-sa # serviceaccount:namespace:operator - system:serviceaccount:rook-ceph:rook-csi-nfs-plugin-sa # serviceaccount:namespace:operator - system:serviceaccount:rook-ceph:rook-csi-nfs-provisioner-sa # serviceaccount:namespace:operator + # Service accounts for the csi operator + - system:serviceaccount:rook-ceph:ceph-csi-cephfs-ctrlplugin-sa # serviceaccount:namespace:operator + - system:serviceaccount:rook-ceph:ceph-csi-cephfs-nodeplugin-sa # serviceaccount:namespace:operator + - system:serviceaccount:rook-ceph:ceph-csi-nfs-ctrlplugin-sa # serviceaccount:namespace:operator + - system:serviceaccount:rook-ceph:ceph-csi-nfs-nodeplugin-sa # serviceaccount:namespace:operator + - system:serviceaccount:rook-ceph:ceph-csi-rbd-ctrlplugin-sa # serviceaccount:namespace:operator + - system:serviceaccount:rook-ceph:ceph-csi-rbd-nodeplugin-sa # serviceaccount:namespace:operator --- # Rook Ceph Operator Config # Use this ConfigMap to override operator configurations