]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/rook: add placement specs to apply rgw
authorJoseph Sawaya <jsawaya@redhat.com>
Fri, 3 Sep 2021 19:47:54 +0000 (15:47 -0400)
committerJoseph Sawaya <jsawaya@redhat.com>
Mon, 27 Sep 2021 18:51:13 +0000 (14:51 -0400)
This commit adds the placement spec option when creating
a CephObjectStore using `orch apply rgw`.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
src/pybind/mgr/rook/rook_cluster.py

index f5cecfa52bcb24fd2c75416e98412443dbbc7fd1..5c701bd0a872408f60f70540f2dbb80c179d6110 100644 (file)
@@ -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: