Commit Graph
71 Commits
Author SHA1 Message Date
Skala Networks d3c3d25c60 csi: bind cephfs and rbd provisionners on non-colliding ports for hostNetwork setups
Signed-off-by: Skala Networks <contact@skala.network>
2025-02-23 06:31:43 -05:00
Madhu Rajanna 279e5f7cac csi: use new flag to enable VGS feature
In the Alpha Version of the VolumeGroupSnapshot
Feature the flag to enable the feature was
`--enable-volume-group-snapshots=true` and in the beta
API the feature is diasbled by default to enable it
we need to set `--feature-gate=CSIVolumeGroupSnapshot=true`

There is a change in the flag between the API version
This PR add a code where we choose the required
flag based on the API version.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-12-10 08:56:45 +01:00
Peter Razumovsky 97a13628e5 core: add capabilities to securityContext to fix CIS 5.2.8
Resolves CIS benchmark 5.2.8 rule by adding capabilities with
explicitly defined empty "add" list (where it needed) and with
NET_RAW capability in "drop" list.

5.2.8 Minimize the admission of containers with added capabilities

Containers must drop the `NET_RAW` capability and are not permitted
to add back any capabilities.

Signed-off-by: Peter Razumovsky <prazumovsky@mirantis.com>
2024-11-05 16:27:43 +04:00
Blaine Gardner 5539eedd1b multus: finish deprecating holder pods
Finish the process of deprecating holder pods by removing Rook's ability
to deploy them. The intent of this change is to make the most
superficial changes possible to accomplish this. There are still
remnants of code in Rook (particularly the CSI controller) that helped
configure or deploy holder pods. Due to the risk of breaking some
features, cleanup work of hose remnants will be deferred for future
work.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-10-23 16:29:02 -06:00
Peter Razumovsky 516eab4d8a core: define empty securityContext for pods to fix CIS 5.7.3
Resolves CIS benchmark rule 5.7.3, Pods part. SecurityContext
should be explicitly defined in pod level of Pod spec section.
It is sufficient to specify empty securityContext to satisfy
CIS 5.7.3 rule.

5.7.3 Apply Security Context to Your Pods and Containers

When designing your containers and pods, make sure
that you configure the security context for your pods,
containers, and volumes.

Signed-off-by: Peter Razumovsky <prazumovsky@mirantis.com>
2024-10-09 16:10:03 +04:00
parth-gr 21ca333ed7 csi: add sc privileged to logrotate sidecar container
deployments on openshift where we need csi container pods
to be run on privileged, the logrotate sidecar container was missing the
privileged permission letting, side car to not run properly

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-09-30 20:14:09 +05:30
Praveen M e30e5e881f csi: explicitly set Topology feature-gate
issue:
external-provisioner (v5) enabled topology feature-gate by default
and the current implementation in Rook uses a conditional block to
enable the topology feature gate. This approach now does not directly
reflect the state of the `CSI_ENABLE_TOPOLOGY`.

fix:
replacing the conditional block with a direct use of the
`CSI_ENABLE_TOPOLOGY` for flag value.

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-07-31 20:37:20 +05:30
Travis Nielsen 9967b161f9 Merge pull request #14420 from YiteGu/make-kube-api-limit-configurable
csi: make kube apiserver qps configurable
2024-07-16 07:40:56 -06:00
yite.gu 80541a23c9 csi: make kube apiserver qps configurable
This commit adds the flexibility to configure kube apiserver qps
as per the user requirement and also keeps the existing values as
the default one.

Signed-off-by: yite.gu <yitegu0@gmail.com>
2024-07-16 18:39:16 +08:00
parth-gr 4ca8b12e12 csi: add log rotation for csi cephfs nfs pod containers
Use the same logrotate flow of rbd, as merged in #14305

1) Make the csi cephfs and nfs container logs persisted in a file

2) Use the cephcluster api specs to configure the log rotate

3) Add log rotation to rotate the log file and
Add a sidecar log collector container

And some fixes on the implementation:

1) Add a operator namespace in the log file path

2) Only add volume to the container if logrotate is enabled

Closes: https://github.com/rook/rook/issues/12809, https://github.com/rook/rook/issues/14429

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-07-12 12:50:35 +05:30
parth-gr 2ca0d1390b csi: add securityContext to csi containers
With the recent enhancements csi containers for using
logrotate, they need to run with securityContext to privileged,
on platform like openshift.
Used the ROOK_HOSTPATH_REQUIRES_PRIVILEGED flag
wich is set with operator deployment to see
if the securityCOntext is needed or not

Closes: https://github.com/rook/rook/issues/14400

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-07-08 18:47:26 +05:30
Travis Nielsen 8e25300ad5 Merge pull request #14199 from Nordix/update-cephfs-clusterroles
csi: add cephfs encryption support
2024-07-01 15:27:38 -06:00
parth-gr d3742119b9 csi: add log rotation for csi rbd pod containers
1) Make the csi rbd container logs persisted in a file
   (csi plugin, csi provisioner, csi addons sidecar)

2) Use the cephcluster api specs to configure the log rotate

3) Add log rotation to rotate the log file and
   Add a sidecar log collector container

part-of: https://github.com/rook/rook/issues/12809

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-06-27 14:20:18 +05:30
NymanRobin 05315ae64f csi: add cephfs encryption support
Ceph-CSI support for fscrypt encryption of cephfs.
To achieve this commit add capability of mounting the
required `rook-ceph-csi-kms-config` configmap into
csi-cephfsplugin-provisioner and nodeplugin pods.

Further it modifies the ClusterRoles `cephfs-csi-nodeplugin` and
`cephfs-external-provisioner-runner` to grant privileges
required for reading encryption configuration and fetching
encryption secrets from either kubernetes secrets or
from a Key Management System (KMS).

These privileges are essential for the proper functioning of
ceph-csi-cephfs with fscrypt encryption.

The following privileges have been added:
- `secrets/get`: Allows reading of secrets for encryption.
- `configmaps/get`: Grants access to configuration maps,
    this is used to read encryption configuration.
- `serviceaccounts/get`: Enables retrieval of service accounts for
    authentication to KMS and for retrieving encryption secrets
    stored there.
- `serviceaccounts/token/create`: Allows creation of service account tokens,
    which are required for authenticating requests to KMS
    when retrieving encryption secrets.

The commit also updated the csi documentation to include cephfs
in the encryption section, with examples updated accordingly.

Signed-off-by: NymanRobin <robin.nyman@est.tech>
2024-05-20 14:03:02 +03:00
Madhu Rajanna 2611e924a2 csi: provide option to configure VGS
volumegroupsnapshot feature will be enabled
by default if the required CRD's are present
if not its disabled and user will have an option
to disable it if they dont require this feature.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-03-01 18:12:37 +01:00
Praveen M d28febaa61 csi: remove CSI_ENABLE_READ_AFFINITY
This commit removes the `CSI_ENABLE_READ_AFFINITY` since
it is no longer utilized after addition of the read affinity
option per cluster via CSIDriverSpec.

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-02-06 20:21:57 +05:30
Madhu Rajanna 9b418d24a1 csi: make leader election flags configurable
This commit adds the flexibility to configure
leader election flags as per the user
requirement and also keeps the existing values
as the default one.

resolve: #13475

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-01-17 10:02:49 +01:00
Praveen M a80396df1b csi: update cmdline args as used by ceph-csi
This commit adds cmdline args to enable
1. RecoverVolumeExpansionFailure
2. PreventVolumeModeConversion
3. HonorPVReclaimPolicy

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-01-12 15:24:07 +05:30
Travis Nielsen 20559ac7a4 Merge pull request #13439 from iPraveenParihar/fix/remove-gRPC-metrics-svc
csi: remove gRPC metrics service
2023-12-19 10:12:21 -07:00
Praveen M 17c9a069bd csi: remove gRPC metrics service
This commit removes the gRPC metrics svc which was missed in PR #13166.

Signed-off-by: Praveen M <m.praveen@ibm.com>
2023-12-19 15:24:56 +05:30
Niels de Vos 1ca1257c65 csi: update the CSI-Addons sidecar to v0.8.0
Quite some improvements have been included in the recently released
v0.8.0 of the CSI-Addons sidecar for Kubernetes. Rook users will benefit
from running the latest version of the sidecar when deploying Ceph-CSI.

See-also: https://github.com/csi-addons/kubernetes-csi-addons/releases/tag/v0.8.0
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-12-15 15:13:42 +01:00
Riya Singhal 401ce4697a csi: add csi-addons sidecar to cephfs deployment
this commit adds csi-addon sidecar to
cephfsplugin provisioner deployment

Signed-off-by: Riya Singhal <rsinghal@redhat.com>
2023-11-22 02:50:45 +05:30
Madhu Rajanna 5658e026cb csi: remove deprecated grpc metrics code
GRPC metrics got deprecated in cephcsi
3.7.0 and the deprecated flags will get
removed in the next release. This PR
removes the deprecated metrics code which
allow us to run with older cephcsi as well.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-11-07 11:24:17 +01:00
Madhu Rajanna 9f2b7d572d csi: fix indentation for mountinfo
Fixed the indentation for the mountinfo
or else an emptyDir is getting created
for it.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-10-12 09:01:26 +02:00
Madhu Rajanna 54ce2a96da csi: add mountinfo path for cephfs daemonset
If mountinfo path is available cephcsi will
try to recover the fuse client. adding the
support for the same in Rook.

fixes: #13009

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-10-06 11:16:23 +02:00
karthik-us 2675c976d5 csi: add maxUnavailable for cephfs csi daemonset
Adding maxUnavailable parameter to the cephfs csi daemonset. The
default value of maxUnavailable = 1 can make the upgrade process
slower in environments with large number of nodes.

Fixes: #12636
Signed-off-by: karthik-us <ksubrahm@redhat.com>
2023-08-07 19:48:21 +05:30
Travis Nielsen 18e2502a69 Merge pull request #12295 from subhamkrai/remve-default-scc
security: remove default scc privileges
2023-07-07 08:24:37 -06:00
subhamkrai 48f84b37e8 security: drop all capabilities to the container
adding drop `ALL` capabilities in rook operator container
as this is not required and will remove warning in ocp cluster.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-07-07 17:06:48 +05:30
Rakshith R d6b8a8f380 csi: remove k8s version check for oidc token
This commit removes k8s version check for oidc token
which required k8s v1.20 or above since minimum
k8s version that rook supports now is v1.22.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-07-06 15:44:45 +05:30
Madhu Rajanna 4c710de791 csi: make AttachRequired as configurable
adding a option to make AttachRequired field
as configurable and added a comment to explain
the consequences of changing the default value

resolves: #11805

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-03-22 12:55:32 +01:00
Madhu Rajanna 3017d563f2 csi: remove default-fstype for cephfs
we dont need to have fstype for cephfs
pvc, removing the unwanted argument
for cephfs.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-03-22 12:55:32 +01:00
Madhu Rajanna 4bdab21db0 nfs: add csi-attacher to NFS provisioner
Add attacher sidecar to NFS provisioner pod
to avoid mounting RWO volumes on two nodes

details: https://github.com/rook/rook/issues/10692

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-03-22 12:55:32 +01:00
Rakshith R 8b9ded1f77 csi: add option to enable read affinity for rbd volumes
This commit adds code to supply variables required
to enable read affinity for rbd volumes.
It leverages `read_from_replica=localize,crush_locations=key:value`
krbd map option from ceph to serve reads from the most local OSD.
refer:
https://docs.ceph.com/en/latest/man/8/rbd/#kernel-rbd-krbd-options

Signed-off-by: Rakshith R <rar@redhat.com>
2023-02-16 19:09:39 +05:30
Madhu Rajanna d7dc12d834 csi: provide way to set cephfs kernel mount options
Exposing CSI configuration for the user to
set the cephfs kernel mount options.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-02-10 08:26:41 +01:00
ac4b47d71a csi: add a parameter to modify the maxUnavailable value of rbd daemonset
The default value of maxUnavailable of daemonset is 1.
Sometimes the upgrade can be slow due to this setting.
So I add a parameter to change the value for rbd daemonset.

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
Co-authored-by: Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp>
Co-authored-by: Yuji Ito <llamerada.jp@gmail.com>
2022-11-21 05:16:15 +00:00
Madhu Rajanna ffdfeb5bec csi: add setmetadata and clustername flag to omap
The omap generator sidecar is the one who
sets the pvc name and clustername in the metadata
if the pv is re-attached to a new pvc or if the
clustername changes, for that reason we need to
set these flags on the omap generator sidecar
also.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-10-18 15:29:58 +02:00
Humble Chirammal b9fb023edf csi: explicitly set default fstype for attacher sidecar
With the attacher sidecar update to v4.0.0 this has to be set
explictly.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-09-29 19:35:24 +05:30
Avan Thakkar 934aa91056 operator: make imagePullPolicy customizable for csi driver and ceph pods
Introduce a new env variable ROOK_CSI_IMAGE_PULL_POLICY in rook operator configmap which should be used to
customize the imagePullPolicy for the csi driver and imagePullPolicy property in cephVersionSpec for ceph pods.

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
2022-09-27 11:57:43 +05:30
Rakshith R 3c5a2f4142 csi: add topology provisioning support
This commit adds topology provisioning
support. This makes modification to rbac,
csi deployment and daemonset.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-12 16:10:18 +05:30
Rakshith R 9c4592720c csi: add NFS expansion support
This commit adds resizer sidecar to
NFS driver and required storageclass
and rbac changes.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-08 16:15:37 +05:30
Rakshith R 73042c7531 csi: add NFS snapshot support
This commit adds snapshotter sidecar to
NFS driver and required yamls and docs too.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-08 16:15:37 +05:30
yati1998 cc4fd0c547 csi: remove controller-ip from csi-addons
This commit removes controller-ip parameter from
csi-addons sidecar as it is no longer required to be
passed.

Signed-off-by: yati1998 <ypadia@redhat.com>
2022-09-07 14:49:32 +05:30
yati1998 9b4361b379 rbdmirror: remove volume replication sidecar
The volume replication operator is being moved to
kubernetes-csi-addons. This commit hence, removes
the volume replication sidecar and updates the
related documentation.
It will also update the csi-addons sidecar version
to the latest one.

Closes: #10655

Signed-off-by: yati1998 <ypadia@redhat.com>
2022-09-07 14:49:19 +05:30
Travis Nielsen 1bbf8f7a43 Merge pull request #10791 from Rakshith-R/use-cephcsi-nfsnodeplugin
csi: use cephcsi image for nfs nodeserver + holder design
2022-09-06 10:52:30 -06:00
Rakshith R 7c6e4d71bc csi: add holder pod support for nfs
This commit adds holder pod support
for nfs to be able to work in non-host
networking scenario, without being
affected by restarts of csi-nfsplugin.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-02 14:16:15 +05:30
Rakshith R 9405b59ff4 csi: use cephcsi image for nfs nodeserver
Cephcsi v3.7 now supports nfs nodeserver.
This commit changes nfs nodeserver image to
cephcsi image and makes other necessary
modifications to template.

Signed-off-by: Rakshith R <rar@redhat.com>
2022-09-02 14:16:15 +05:30
Madhu Rajanna 32943b64e3 csi: add missing serviceAccoutName to holder
Add missing serviceAccountName for the holder
daemonset to create the pods with required
access.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-09-02 13:20:47 +05:30
Prasanna Kumar Kalever e376c17bfb csi: provide a way to set --clustername at csi driver
One can now use the operator configmap for CSI_CLUSTER_NAME variable
for setting ClusterName on the RBD images and CephFS subvolume.
This will be useful in cases like for example, when two container orchestrator
clusters (Kubernetes/OCP) are using a single ceph cluster.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2022-08-23 12:12:02 +05:30
Prasanna Kumar Kalever b5b8cbf6ae csi: provide a way to enable --setmetadata at csi driver
One can now tweak the operator configmap for CSI_ENABLE_METADATA boolean to
enable/disable setting of PV/PVC/PVCNamespace &
snapshot-name/snapshot-namespace/snapshotcontent-name on the RBD images
and CephFS subvolume.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2022-08-23 12:11:02 +05:30
Mudit Agarwal 40081cbcd2 Revert "csi: remove attacher sidecar from CephFS rook deployment"
This reverts commit 4bfd88dc4d.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2022-08-10 13:04:14 +05:30