]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: reschedule haproxy from an offline host 51214/head
authorMichael Fritch <mfritch@suse.com>
Mon, 17 Apr 2023 14:14:07 +0000 (08:14 -0600)
committerAdam King <adking@redhat.com>
Tue, 25 Apr 2023 17:05:40 +0000 (13:05 -0400)
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 <mfritch@suse.com>
(cherry picked from commit 5273a86588b37993a5457fb6a16e3940a53d8a47)

src/pybind/mgr/cephadm/tests/test_scheduling.py
src/pybind/mgr/cephadm/utils.py

index 2454dc0d1ad0b2ed746ee1a36c8d86ad44494943..14c51848a30ffccbf4d873b8b7993f872c81220d 100644 (file)
@@ -1567,12 +1567,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:
index a4940c361a48f7433464e8e1eb5ff985aba62cd5..25337c0ae2a56fca703b77e39e5d1239f39d589f 100644 (file)
@@ -24,7 +24,7 @@ class CephadmNoImage(Enum):
 CEPH_TYPES = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', 'rbd-mirror', 'cephfs-mirror']
 GATEWAY_TYPES = ['iscsi', 'nfs']
 MONITORING_STACK_TYPES = ['node-exporter', 'prometheus', 'alertmanager', 'grafana']
-RESCHEDULE_FROM_OFFLINE_HOSTS_TYPES = ['nfs']
+RESCHEDULE_FROM_OFFLINE_HOSTS_TYPES = ['haproxy', 'nfs']
 
 CEPH_UPGRADE_ORDER = CEPH_TYPES + GATEWAY_TYPES + MONITORING_STACK_TYPES