Support topologySpreadConstraints to spread OSD pods among failure domains as even as possible. https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ Without this feature, the number of OSD pods would be different between the failure domains very much. At worst, there is a possibility that a failure domain has many OSDs and other failure domains have no OSDs. It can partly be mitigated with podAntiAffinity. However, it only works if there are at most one OSD per node. For more detail, please refer to the following document. https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/cluster-on-pvc.yaml#L59 Closes: https://github.com/rook/rook/issues/4387 Signed-off-by: Hiroshi Muraoka <h.muraoka714@gmail.com> Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
80 lines
3.2 KiB
YAML
80 lines
3.2 KiB
YAML
#################################################################################################################
|
|
# Create an object store with settings for replication in a production environment. A minimum of 3 hosts with
|
|
# OSDs are required in this example.
|
|
# kubectl create -f object.yaml
|
|
#################################################################################################################
|
|
|
|
apiVersion: ceph.rook.io/v1
|
|
kind: CephObjectStore
|
|
metadata:
|
|
name: my-store
|
|
namespace: rook-ceph
|
|
spec:
|
|
# The pool spec used to create the metadata pools. Must use replication.
|
|
metadataPool:
|
|
failureDomain: host
|
|
replicated:
|
|
size: 3
|
|
# 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
|
|
# 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
|
|
#targetSizeRatio: .5
|
|
# The pool spec used to create the data pool. Can use replication or erasure coding.
|
|
dataPool:
|
|
failureDomain: host
|
|
replicated:
|
|
size: 3
|
|
# 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
|
|
# 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
|
|
#targetSizeRatio: .5
|
|
# Inline compression mode for the data pool
|
|
# Further reference: https://docs.ceph.com/docs/nautilus/rados/configuration/bluestore-config-ref/#inline-compression
|
|
compressionMode: none
|
|
# Whether to preserve metadata and data pools on object store deletion
|
|
preservePoolsOnDelete: false
|
|
# The gateway service configuration
|
|
gateway:
|
|
# type of the gateway (s3)
|
|
type: s3
|
|
# A reference to the secret in the rook namespace where the ssl certificate is stored
|
|
sslCertificateRef:
|
|
# The port that RGW pods will listen on (http)
|
|
port: 80
|
|
# The port that RGW pods will listen on (https). An ssl certificate is required.
|
|
securePort:
|
|
# The number of pods in the rgw deployment
|
|
instances: 1
|
|
# The affinity rules to apply to the rgw deployment or daemonset.
|
|
placement:
|
|
# nodeAffinity:
|
|
# requiredDuringSchedulingIgnoredDuringExecution:
|
|
# nodeSelectorTerms:
|
|
# - matchExpressions:
|
|
# - key: role
|
|
# operator: In
|
|
# values:
|
|
# - rgw-node
|
|
# topologySpreadConstraints:
|
|
# tolerations:
|
|
# - key: rgw-node
|
|
# operator: Exists
|
|
# podAffinity:
|
|
# podAntiAffinity:
|
|
# A key/value list of annotations
|
|
annotations:
|
|
# key: value
|
|
resources:
|
|
# The requests and limits set here, allow the object store gateway Pod(s) to use half of one CPU core and 1 gigabyte of memory
|
|
# limits:
|
|
# cpu: "500m"
|
|
# memory: "1024Mi"
|
|
# requests:
|
|
# cpu: "500m"
|
|
# memory: "1024Mi"
|
|
# priorityClassName: my-priority-class
|