Skip to content

Commit e22b106

Browse files
committed
mgr/cephadm: implement get_daemon_deployment_ordering for ingress
We will now deploy haproxy daemons before keepalive daemons in cases where the scheduler decides we need to deploy both. Signed-off-by: Adam King <[email protected]> (cherry picked from commit d2a9f8c) Resolves: rhbz#2372821
1 parent 6cef95d commit e22b106

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/pybind/mgr/cephadm/services/ingress.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ def generate_config(
7474
return self.keepalived_generate_config(daemon_spec)
7575
assert False, "unexpected daemon type"
7676

77+
def get_daemon_deployment_ordering(self, daemons: List[CephadmDaemonDeploySpec]) -> Dict[int, List[CephadmDaemonDeploySpec]]:
78+
if not daemons:
79+
return {}
80+
dtype = daemons[0].daemon_type
81+
if not any(d.daemon_type != dtype for d in daemons):
82+
# if all the daemons we got are the same type we can
83+
# just deploy them in parallel
84+
return {0: daemons}
85+
# if we got here, we should have both haproxy and keepalived daemons
86+
ordering: Dict[int, List[CephadmDaemonDeploySpec]] = {}
87+
ordering[0] = [d for d in daemons if d.daemon_type == 'haproxy']
88+
ordering[1] = [d for d in daemons if d.daemon_type == 'keepalived']
89+
return ordering
90+
7791
def haproxy_prepare_create(
7892
self,
7993
daemon_spec: CephadmDaemonDeploySpec,

0 commit comments

Comments
 (0)