From f1c0b0758abec5e752df5f1477e8b03e2342689a Mon Sep 17 00:00:00 2001 From: Joseph Sawaya Date: Fri, 3 Sep 2021 15:47:54 -0400 Subject: [PATCH] mgr/rook: add placement specs to apply rgw This commit adds the placement spec option when creating a CephObjectStore using `orch apply rgw`. Signed-off-by: Joseph Sawaya --- src/pybind/mgr/rook/rook_cluster.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index f5cecfa52bc..5c701bd0a87 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -907,7 +907,7 @@ class RookCluster(object): # translate . to - (fingers crossed!) instead. name = spec.service_id.replace('.', '-') - + all_hosts = self.get_hosts() def _create_zone() -> cos.CephObjectStore: port = None secure_port = None @@ -926,7 +926,16 @@ class RookCluster(object): port=port, securePort=secure_port, instances=spec.placement.count or 1, - ) + placement=ccl.NodeAffinity( + requiredDuringSchedulingIgnoredDuringExecution=ccl.RequiredDuringSchedulingIgnoredDuringExecution( + nodeSelectorTerms=ccl.NodeSelectorTermsList( + [ + placement_spec_to_node_selector(spec.placement, all_hosts) + ] + ) + ) + ) + ), ) ) if spec.rgw_zone: -- 2.39.5