Skip to content

CSI Configuration

CSI drivers are managed by the ceph-csi-operator. This means CSI tuning is done through CSI operator custom resources (OperatorConfig and Driver) and the ConfigMap rook-csi-operator-image-set-configmap.

Important

The Rook ConfigMap rook-ceph-operator-config no longer applies CSI settings.

This document provides some example CSI settings that may need to be customized.

OperatorConfig vs Driver

Per the ceph-csi-operator design, OperatorConfig holds operator-wide defaults. Each Driver CR manages one driver instance and allows per-driver customization. Driver spec fields take precedence over matching driverSpecDefaults on OperatorConfig.

Many settings can be set on either resource. Use them as follows:

  • OperatorConfig (ceph-csi-operator-config) — one per operator namespace. Set spec.driverSpecDefaults for defaults that apply to all CSI drivers (RBD, CephFS, NFS, and others), such as shared images, log level, controller replica count, or node plugin kubelet path.
  • Driver — one CR per driver type (for example rook-ceph.rbd.csi.ceph.com). Use spec on a Driver to override those defaults for a single driver, or to set options that only apply to that driver (for example deployCsiAddons on RBD only, or cephFsClientType on CephFS).

Default CSI Settings

The default CSI settings are applied by Rook in deploy/examples/operator.yaml (the section after the operator ConfigMap).

CSI settings reference

For the complete list of ceph-csi-operator chart settings, see: Ceph-CSI Drivers chart configuration.

CSI-Addons sidecar

Previously: CSI_ENABLE_CSIADDONS in rook-ceph-operator-config. Now set deployCsiAddons on OperatorConfig or Driver.

1
2
3
4
5
6
7
8
9
# OperatorConfig (manifest)
apiVersion: csi.ceph.io/v1
kind: OperatorConfig
metadata:
  name: ceph-csi-operator-config
  namespace: rook-ceph
spec:
  driverSpecDefaults:
    deployCsiAddons: true

Custom container images

Previously: CSI_*_IMAGE keys in rook-ceph-operator-config. Now use the ImageSet ConfigMap referenced by OperatorConfig.

See deploy/examples/operator.yaml.

Controller replicas and strategy

Previously: CSI_PROVISIONER_REPLICAS in rook-ceph-operator-config. Now use controllerPlugin.replicas and controllerPlugin.deploymentStrategy.

1
2
3
4
5
6
7
# OperatorConfig (manifest)
spec:
  driverSpecDefaults:
    controllerPlugin:
      replicas: 1
      deploymentStrategy:
        type: Recreate

CephFS client type (kernel vs FUSE)

Previously: CSI_FORCE_CEPHFS_KERNEL_CLIENT in rook-ceph-operator-config. Now use cephFsClientType on OperatorConfig or the CephFS Driver.

1
2
3
4
5
6
7
8
# Driver-specific override (manifest)
apiVersion: csi.ceph.io/v1
kind: Driver
metadata:
  name: rook-ceph.cephfs.csi.ceph.com
  namespace: rook-ceph
spec:
  cephFsClientType: fuse

Driver name prefix

Previously: CSI_DRIVER_NAME_PREFIX in rook-ceph-operator-config. Now the Driver CR metadata.name is the provisioner name used in StorageClasses and VolumeSnapshotClasses.

apiVersion: csi.ceph.io/v1
kind: Driver
metadata:
  name: my-prefix.rbd.csi.ceph.com
  namespace: rook-ceph
spec:
  controllerPlugin: {}
  nodePlugin:
    updateStrategy:
      type: RollingUpdate

Enable NFS CSI driver

Previously: NFS CSI deployment was reconciled by the Rook operator. Now create the NFS Driver CR.

kubectl apply -f deploy/examples/csi/nfs/driver.yaml

Node plugin kubelet path and SELinux host mount

Previously: CSI_KUBELET_DIR_PATH and CSI_PLUGIN_ENABLE_SELINUX_HOST_MOUNT in rook-ceph-operator-config. Now use nodePlugin.kubeletDirPath and nodePlugin.enableSeLinuxHostMount.

1
2
3
4
5
6
# OperatorConfig (manifest)
spec:
  driverSpecDefaults:
    nodePlugin:
      kubeletDirPath: /var/lib/kubelet
      enableSeLinuxHostMount: true