2019-03-13 23:15:14 -06:00
|
|
|
#################################################################################################################
|
|
|
|
|
# Create a filesystem with settings for erasure-coding instead of replication. A minimum of three nodes with OSDs
|
|
|
|
|
# are required in this example since the default failureDomain is host.
|
|
|
|
|
# kubectl create -f filesystem-ec.yaml
|
|
|
|
|
#################################################################################################################
|
|
|
|
|
|
2018-12-03 15:08:29 -07:00
|
|
|
apiVersion: ceph.rook.io/v1
|
2018-12-03 23:48:40 -07:00
|
|
|
kind: CephFilesystem
|
2018-08-16 11:36:21 +02:00
|
|
|
metadata:
|
|
|
|
|
name: myfs-ec
|
2020-12-09 13:21:15 -07:00
|
|
|
namespace: rook-ceph # namespace:cluster
|
2018-08-16 11:36:21 +02:00
|
|
|
spec:
|
|
|
|
|
# The metadata pool spec
|
|
|
|
|
metadataPool:
|
|
|
|
|
replicated:
|
|
|
|
|
# You need at least three OSDs on different nodes for this config to work
|
|
|
|
|
size: 3
|
|
|
|
|
# The list of data pool specs
|
|
|
|
|
dataPools:
|
2021-08-02 11:06:07 +05:30
|
|
|
# For erasure coded pools, we have to create a replicated pool as the default
|
|
|
|
|
# data pool and an erasure-coded pool as a secondary pool.
|
|
|
|
|
- replicated:
|
|
|
|
|
size: 3
|
2018-08-16 11:36:21 +02:00
|
|
|
# You need at least three `bluestore` OSDs on different nodes for this config to work
|
2021-12-02 16:34:54 +04:00
|
|
|
- name: erasurecoded
|
|
|
|
|
erasureCoded:
|
2018-08-16 11:36:21 +02:00
|
|
|
dataChunks: 2
|
|
|
|
|
codingChunks: 1
|
2020-03-30 17:28:10 -04:00
|
|
|
# Inline compression mode for the data pool
|
2020-09-24 18:30:19 +01:00
|
|
|
parameters:
|
|
|
|
|
compression_mode: none
|
2020-10-27 02:20:11 +00:00
|
|
|
# Whether to preserve filesystem after CephFilesystem CRD deletion
|
|
|
|
|
preserveFilesystemOnDelete: true
|
2018-08-16 11:36:21 +02: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
|
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:
|
|
|
|
|
- weight: 100
|
|
|
|
|
podAffinityTerm:
|
|
|
|
|
labelSelector:
|
|
|
|
|
matchExpressions:
|
2020-01-14 12:01:47 +01:00
|
|
|
- key: app
|
|
|
|
|
operator: In
|
|
|
|
|
values:
|
2021-03-08 12:18:21 +05:30
|
|
|
- rook-ceph-mds
|
|
|
|
|
# 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
|
|
|
|
|
annotations:
|
|
|
|
|
# key: value
|
2020-08-14 14:29:02 +02:00
|
|
|
# A key/value list of labels
|
|
|
|
|
labels:
|
|
|
|
|
# key: value
|
2018-08-16 11:36:21 +02:00
|
|
|
resources:
|
|
|
|
|
# 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"
|
2019-08-04 15:40:29 -05:00
|
|
|
# priorityClassName: my-priority-class
|
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)
|
2025-11-14 14:40:31 -07:00
|
|
|
# export: # export=<0-256> (disabled=-1)
|
|
|
|
|
# random: # random=[0.0, 1.0](disabled=0.0)
|