2019-03-13 23:15:14 -06:00
|
|
|
#################################################################################################################
|
|
|
|
|
# Create a filesystem with settings with replication enabled for a production environment.
|
|
|
|
|
# A minimum of 3 OSDs on different nodes are required in this example.
|
2023-02-13 17:25:15 +01:00
|
|
|
# If one mds daemon per node is too restrictive, see the podAntiAffinity below.
|
2019-03-13 23:15:14 -06:00
|
|
|
# kubectl create -f filesystem.yaml
|
|
|
|
|
#################################################################################################################
|
|
|
|
|
|
2018-12-03 15:08:29 -07:00
|
|
|
apiVersion: ceph.rook.io/v1
|
2018-12-03 23:48:40 -07:00
|
|
|
kind: CephFilesystem
|
2017-10-05 10:00:19 -07:00
|
|
|
metadata:
|
|
|
|
|
name: myfs
|
2020-12-09 13:21:15 -07:00
|
|
|
namespace: rook-ceph # namespace:cluster
|
2017-10-05 10:00:19 -07:00
|
|
|
spec:
|
2019-03-13 23:15:14 -06:00
|
|
|
# The metadata pool spec. Must use replication.
|
2017-10-05 10:00:19 -07:00
|
|
|
metadataPool:
|
|
|
|
|
replicated:
|
2019-03-13 23:15:14 -06:00
|
|
|
size: 3
|
2020-02-20 11:37:09 +01:00
|
|
|
requireSafeReplicaSize: true
|
2020-06-09 18:16:58 +02:00
|
|
|
parameters:
|
|
|
|
|
# Inline compression mode for the data pool
|
2021-07-28 14:00:35 -06:00
|
|
|
# Further reference: https://docs.ceph.com/docs/master/rados/configuration/bluestore-config-ref/#inline-compression
|
2021-03-08 12:18:21 +05:30
|
|
|
compression_mode:
|
|
|
|
|
none
|
2020-06-09 18:16:58 +02:00
|
|
|
# gives a hint (%) to Ceph in terms of expected consumption of the total cluster capacity of a given pool
|
|
|
|
|
# for more info: https://docs.ceph.com/docs/master/rados/operations/placement-groups/#specifying-expected-pool-size
|
2020-07-17 11:16:00 -06:00
|
|
|
#target_size_ratio: ".5"
|
2019-03-13 23:15:14 -06:00
|
|
|
# The list of data pool specs. Can use replication or erasure coding.
|
2017-10-05 10:00:19 -07:00
|
|
|
dataPools:
|
2021-12-02 16:34:54 +04:00
|
|
|
- name: replicated
|
|
|
|
|
failureDomain: host
|
2017-11-28 14:55:30 -08:00
|
|
|
replicated:
|
2019-03-13 23:15:14 -06:00
|
|
|
size: 3
|
2020-02-20 11:37:09 +01:00
|
|
|
# Disallow setting pool with replica 1, this could lead to data loss without recovery.
|
|
|
|
|
# Make sure you're *ABSOLUTELY CERTAIN* that is what you want
|
|
|
|
|
requireSafeReplicaSize: true
|
2020-06-09 18:16:58 +02:00
|
|
|
parameters:
|
|
|
|
|
# Inline compression mode for the data pool
|
2021-07-28 14:00:35 -06:00
|
|
|
# Further reference: https://docs.ceph.com/docs/master/rados/configuration/bluestore-config-ref/#inline-compression
|
2021-03-08 12:18:21 +05:30
|
|
|
compression_mode:
|
|
|
|
|
none
|
2020-06-09 18:16:58 +02:00
|
|
|
# gives a hint (%) to Ceph in terms of expected consumption of the total cluster capacity of a given pool
|
|
|
|
|
# for more info: https://docs.ceph.com/docs/master/rados/operations/placement-groups/#specifying-expected-pool-size
|
2020-07-17 11:16:00 -06:00
|
|
|
#target_size_ratio: ".5"
|
2020-10-27 02:20:11 +00:00
|
|
|
# Whether to preserve filesystem after CephFilesystem CRD deletion
|
|
|
|
|
preserveFilesystemOnDelete: true
|
2017-10-05 10:00:19 -07:00
|
|
|
# The metadata service (mds) configuration
|
|
|
|
|
metadataServer:
|
|
|
|
|
# The number of active MDS instances
|
|
|
|
|
activeCount: 1
|
|
|
|
|
# Whether each active MDS instance will have an active standby with a warm metadata cache for faster failover.
|
|
|
|
|
# If false, standbys will be available, but will not have a warm cache.
|
|
|
|
|
activeStandby: true
|
|
|
|
|
# The affinity rules to apply to the mds deployment
|
|
|
|
|
placement:
|
2021-03-08 12:18:21 +05:30
|
|
|
# nodeAffinity:
|
|
|
|
|
# requiredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
|
# nodeSelectorTerms:
|
|
|
|
|
# - matchExpressions:
|
|
|
|
|
# - key: role
|
|
|
|
|
# operator: In
|
|
|
|
|
# values:
|
|
|
|
|
# - mds-node
|
|
|
|
|
# topologySpreadConstraints:
|
|
|
|
|
# tolerations:
|
|
|
|
|
# - key: mds-node
|
|
|
|
|
# operator: Exists
|
|
|
|
|
# podAffinity:
|
|
|
|
|
podAntiAffinity:
|
|
|
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
2019-08-21 13:46:42 +05:30
|
|
|
- labelSelector:
|
|
|
|
|
matchExpressions:
|
2021-03-08 12:18:21 +05:30
|
|
|
- key: app
|
|
|
|
|
operator: In
|
|
|
|
|
values:
|
|
|
|
|
- rook-ceph-mds
|
2023-02-13 17:25:15 +01:00
|
|
|
## Add this if you want to allow mds daemons for different filesystems to run on one
|
|
|
|
|
## node. The value in "values" must match .metadata.name.
|
|
|
|
|
# - key: rook_file_system
|
|
|
|
|
# operator: In
|
|
|
|
|
# values:
|
|
|
|
|
# - myfs
|
2019-08-21 13:46:42 +05:30
|
|
|
# topologyKey: kubernetes.io/hostname will place MDS across different hosts
|
|
|
|
|
topologyKey: kubernetes.io/hostname
|
2021-03-08 12:18:21 +05:30
|
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
2020-01-14 12:01:47 +01:00
|
|
|
- weight: 100
|
|
|
|
|
podAffinityTerm:
|
|
|
|
|
labelSelector:
|
|
|
|
|
matchExpressions:
|
2021-03-08 12:18:21 +05:30
|
|
|
- key: app
|
|
|
|
|
operator: In
|
|
|
|
|
values:
|
|
|
|
|
- rook-ceph-mds
|
2020-01-14 12:01:47 +01:00
|
|
|
# topologyKey: */zone can be used to spread MDS across different AZ
|
|
|
|
|
topologyKey: topology.kubernetes.io/zone
|
2019-03-05 11:21:57 +01:00
|
|
|
# A key/value list of annotations
|
2022-01-10 20:58:55 +05:30
|
|
|
# annotations:
|
2019-03-05 11:21:57 +01:00
|
|
|
# key: value
|
2020-08-14 14:29:02 +02:00
|
|
|
# A key/value list of labels
|
2022-01-10 20:58:55 +05:30
|
|
|
# labels:
|
2020-08-14 14:29:02 +02:00
|
|
|
# key: value
|
2022-01-10 20:58:55 +05:30
|
|
|
# resources:
|
2017-11-06 18:38:11 +01:00
|
|
|
# The requests and limits set here, allow the filesystem MDS Pod(s) to use half of one CPU core and 1 gigabyte of memory
|
|
|
|
|
# limits:
|
|
|
|
|
# memory: "1024Mi"
|
|
|
|
|
# requests:
|
|
|
|
|
# cpu: "500m"
|
|
|
|
|
# memory: "1024Mi"
|
2022-04-18 10:13:08 -06:00
|
|
|
priorityClassName: system-cluster-critical
|
2022-01-10 20:58:55 +05:30
|
|
|
livenessProbe:
|
|
|
|
|
disabled: false
|
|
|
|
|
startupProbe:
|
|
|
|
|
disabled: false
|
2021-04-08 15:44:27 +02:00
|
|
|
# Filesystem mirroring settings
|
|
|
|
|
# mirroring:
|
2024-02-07 17:30:44 -07:00
|
|
|
# enabled: true
|
|
|
|
|
# # list of Kubernetes Secrets containing the peer token
|
|
|
|
|
# # for more details see: https://docs.ceph.com/en/latest/dev/cephfs-mirroring/#bootstrap-peers
|
|
|
|
|
# # Add the secret name if it already exists else specify the empty list here.
|
|
|
|
|
# peers:
|
|
|
|
|
# secretNames:
|
|
|
|
|
# - secondary-cluster-peer
|
|
|
|
|
# # specify the schedule(s) on which snapshots should be taken
|
|
|
|
|
# # see the official syntax here https://docs.ceph.com/en/latest/cephfs/snap-schedule/#add-and-remove-schedules
|
|
|
|
|
# snapshotSchedules:
|
|
|
|
|
# - path: /
|
|
|
|
|
# interval: 24h # daily snapshots
|
|
|
|
|
# # The startTime should be mentioned in the format YYYY-MM-DDTHH:MM:SS
|
|
|
|
|
# # If startTime is not specified, then by default the start time is considered as midnight UTC.
|
|
|
|
|
# # see usage here https://docs.ceph.com/en/latest/cephfs/snap-schedule/#usage
|
|
|
|
|
# # startTime: 2022-07-15T11:55:00
|
|
|
|
|
# # manage retention policies
|
|
|
|
|
# # see syntax duration here https://docs.ceph.com/en/latest/cephfs/snap-schedule/#add-and-remove-retention-policies
|
|
|
|
|
# snapshotRetention:
|
|
|
|
|
# - path: /
|
|
|
|
|
# duration: "h 24"
|
2022-07-05 20:01:11 +05:30
|
|
|
---
|
|
|
|
|
# create default csi subvolume group
|
|
|
|
|
apiVersion: ceph.rook.io/v1
|
|
|
|
|
kind: CephFilesystemSubVolumeGroup
|
|
|
|
|
metadata:
|
|
|
|
|
name: myfs-csi # lets keep the svg crd name same as `filesystem name + csi` for the default csi svg
|
|
|
|
|
namespace: rook-ceph # namespace:cluster
|
|
|
|
|
spec:
|
|
|
|
|
# The name of the subvolume group. If not set, the default is the name of the subvolumeGroup CR.
|
|
|
|
|
name: csi
|
|
|
|
|
# filesystemName is the metadata name of the CephFilesystem CR where the subvolume group will be created
|
|
|
|
|
filesystemName: myfs
|
2023-12-01 19:37:36 +05:30
|
|
|
# reference https://docs.ceph.com/en/latest/cephfs/fs-volumes/#pinning-subvolumes-and-subvolume-groups
|
|
|
|
|
# only one out of (export, distributed, random) can be set at a time
|
|
|
|
|
# by default pinning is set with value: distributed=1
|
|
|
|
|
# for disabling default values set (distributed=0)
|
|
|
|
|
pinning:
|
2024-02-07 17:30:44 -07:00
|
|
|
distributed: 1 # distributed=<0, 1> (disabled=0)
|
2023-12-01 19:37:36 +05:30
|
|
|
# export: # export=<0-256> (disabled=-1)
|
|
|
|
|
# random: # random=[0.0, 1.0](disabled=0.0)
|