From 246b4eb7bde76e8f37ed4e361da5d513fdb22170 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Mon, 17 Apr 2023 08:14:07 -0600 Subject: [PATCH] cephadm: reschedule haproxy from an offline host The ingress service (haproxy+keepalived) should be redeployed from an offline host to allow for client recovery during failover. Fixes: https://tracker.ceph.com/issues/59472 Signed-off-by: Michael Fritch (cherry picked from commit 5273a86588b37993a5457fb6a16e3940a53d8a47) --- .../mgr/cephadm/tests/test_scheduling.py | 34 +++++++++++++++++-- src/pybind/mgr/cephadm/utils.py | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/cephadm/tests/test_scheduling.py b/src/pybind/mgr/cephadm/tests/test_scheduling.py index fcdee838bb4..11beffd158e 100644 --- a/src/pybind/mgr/cephadm/tests/test_scheduling.py +++ b/src/pybind/mgr/cephadm/tests/test_scheduling.py @@ -1577,12 +1577,40 @@ class RescheduleFromOfflineTest(NamedTuple): [[]], [[]], ), + RescheduleFromOfflineTest( + 'ingress', + PlacementSpec(count=1), + 'host1 host2'.split(), + [], + ['host2'], + [ + DaemonDescription('haproxy', 'b', 'host2'), + DaemonDescription('keepalived', 'b', 'host2'), + ], + [['host1']], + [[]], + ), ]) def test_remove_from_offline(service_type, placement, hosts, maintenance_hosts, offline_hosts, daemons, expected_add, expected_remove): - spec = ServiceSpec(service_type=service_type, - service_id='test', - placement=placement) + if service_type == 'ingress': + spec = \ + IngressSpec( + service_type='ingress', + service_id='nfs-ha.foo', + frontend_port=443, + monitor_port=8888, + virtual_ip='10.0.0.20/8', + backend_service='nfs-ha.foo', + placement=placement, + ) + else: + spec = \ + ServiceSpec( + service_type=service_type, + service_id='test', + placement=placement, + ) host_specs = [HostSpec(h) for h in hosts] for h in host_specs: diff --git a/src/pybind/mgr/cephadm/utils.py b/src/pybind/mgr/cephadm/utils.py index ebceba7ceae..4ea4cfb1eb0 100644 --- a/src/pybind/mgr/cephadm/utils.py +++ b/src/pybind/mgr/cephadm/utils.py @@ -26,7 +26,7 @@ CEPH_TYPES = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', GATEWAY_TYPES = ['iscsi', 'nfs'] MONITORING_STACK_TYPES = ['node-exporter', 'prometheus', 'alertmanager', 'grafana', 'loki', 'promtail'] -RESCHEDULE_FROM_OFFLINE_HOSTS_TYPES = ['nfs'] +RESCHEDULE_FROM_OFFLINE_HOSTS_TYPES = ['haproxy', 'nfs'] CEPH_UPGRADE_ORDER = CEPH_TYPES + GATEWAY_TYPES + MONITORING_STACK_TYPES -- 2.39.5