From b70b098405f34b756bad93f66ddf97e462ca0f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 5 Oct 2020 15:46:22 +0200 Subject: [PATCH] ceph: add support for stretched cluster crush rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pool spec has now a new property called "replicasPerFailureDomain" which essentially represents the number of replicas to store in each failure domain. Assuming the failure domain is a datacenter (if the cluster is stretched) then you will have 2 replicas per datacenter where each replica ends up on a different host. This gives you a total of 4 replicas and for this, the "size" must be set to 4. Closes: https://github.com/rook/rook/issues/5591 Signed-off-by: Sébastien Han --- Documentation/ceph-pool-crd.md | 41 ++++ PendingReleaseNotes.md | 1 + .../charts/rook-ceph/templates/resources.yaml | 20 ++ cluster/examples/kubernetes/ceph/common.yaml | 20 ++ cluster/examples/kubernetes/ceph/pool.yaml | 4 + pkg/apis/ceph.rook.io/v1/types.go | 15 +- pkg/daemon/ceph/client/crush.go | 110 +++++++++-- pkg/daemon/ceph/client/crush_rule.go | 144 ++++++++++++++ pkg/daemon/ceph/client/crush_rule_test.go | 137 +++++++++++++ pkg/daemon/ceph/client/crush_test.go | 5 + pkg/daemon/ceph/client/pool.go | 111 ++++++++++- pkg/daemon/ceph/client/pool_test.go | 3 - pkg/operator/ceph/object/spec_test.go | 12 +- pkg/operator/ceph/pool/controller_test.go | 123 ------------ pkg/operator/ceph/pool/validate.go | 28 ++- pkg/operator/ceph/pool/validate_test.go | 186 ++++++++++++++++++ tests/framework/installer/ceph_manifests.go | 20 ++ 17 files changed, 827 insertions(+), 153 deletions(-) create mode 100644 pkg/daemon/ceph/client/crush_rule.go create mode 100644 pkg/daemon/ceph/client/crush_rule_test.go create mode 100644 pkg/operator/ceph/pool/validate_test.go diff --git a/Documentation/ceph-pool-crd.md b/Documentation/ceph-pool-crd.md index e50c63a95..245afada6 100644 --- a/Documentation/ceph-pool-crd.md +++ b/Documentation/ceph-pool-crd.md @@ -106,6 +106,44 @@ external-cluster-console# rbd mirror pool peer bootstrap import