Ceph Shared File System CRD

Rook allows creation and customization of shared file systems through the custom resource definitions (CRDs). The following settings are available for Ceph file systems.

Sample

  1. apiVersion: ceph.rook.io/v1beta1
  2. kind: Filesystem
  3. metadata:
  4. name: myfs
  5. namespace: rook-ceph
  6. spec:
  7. metadataPool:
  8. replicated:
  9. size: 3
  10. dataPools:
  11. - erasureCoded:
  12. dataChunks: 2
  13. codingChunks: 1
  14. metadataServer:
  15. activeCount: 1
  16. activeStandby: true
  17. placement:
  18. # nodeAffinity:
  19. # requiredDuringSchedulingIgnoredDuringExecution:
  20. # nodeSelectorTerms:
  21. # - matchExpressions:
  22. # - key: role
  23. # operator: In
  24. # values:
  25. # - mds-node
  26. # tolerations:
  27. # - key: mds-node
  28. # operator: Exists
  29. # podAffinity:
  30. # podAntiAffinity:
  31. resources:
  32. # limits:
  33. # cpu: "500m"
  34. # memory: "1024Mi"
  35. # requests:
  36. # cpu: "500m"
  37. # memory: "1024Mi"

File System Settings

Metadata

  • name: The name of the file system to create, which will be reflected in the pool and other resource names.
  • namespace: The namespace of the Rook cluster where the file system is created.

Pools

The pools allow all of the settings defined in the Pool CRD spec. For more details, see the Pool CRD settings. In the example above, there must be at least three hosts (size 3) and at least eight devices (6 data + 2 coding chunks) in the cluster.

  • metadataPool: The settings used to create the file system metadata pool. Must use replication.
  • dataPools: The settings to create the file system data pools. If multiple pools are specified, Rook will add the pools to the file system. Assigning users or files to a pool is left as an exercise for the reader with the CephFS documentation. The data pools can use replication or erasure coding. If erasure coding pools are specified, the cluster must be running with bluestore enabled on the OSDs.

Metadata Server Settings

The metadata server settings correspond to the MDS daemon settings.

  • activeCount: The number of active MDS instances. As load increases, CephFS will automatically partition the file system across the MDS instances. Rook will create double the number of MDS instances as requested by the active count. The extra instances will be in standby mode for failover.
  • activeStandby: If true, the extra MDS instances will be in active standby mode and will keep a warm cache of the file system metadata for faster failover. The instances will be assigned by CephFS in failover pairs. If false, the extra MDS instances will all be on passive standby mode and will not maintain a warm cache of the metadata.
  • placement: The mds pods can be given standard Kubernetes placement restrictions with nodeAffinity, tolerations, podAffinity, and podAntiAffinity similar to placement defined for daemons configured by the cluster CRD.
  • resources: Set resource requests/limits for the Filesystem MDS Pod(s), see Resource Requirements/Limits.