]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/nfs: Add VIP to HAProxy_Hosts list for imgress type haproxy-protocol
authorShweta Bhosale <Shweta.Bhosale1@ibm.com>
Mon, 21 Apr 2025 06:40:58 +0000 (12:10 +0530)
committerAdam King <adking@redhat.com>
Sat, 21 Jun 2025 18:55:34 +0000 (14:55 -0400)
Fixes: https://tracker.ceph.com/issues/70985
Signed-off-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
(cherry picked from commit 76f10dbc1fd01ef5046c9f8a6a3990ad87016b17)

src/pybind/mgr/cephadm/services/nfs.py
src/pybind/mgr/nfs/cluster.py

index 933d980886bb84d3dcaea95ff70ebf2477f475ba..b695fa0b44cc1c56f1327dd0fb6d80da8d2c169c 100644 (file)
@@ -102,7 +102,7 @@ class NFSService(CephService):
         # create the RGW keyring
         rgw_user = f'{rados_user}-rgw'
         rgw_keyring = self.create_rgw_keyring(daemon_spec)
-        if spec.virtual_ip:
+        if spec.virtual_ip and not spec.enable_haproxy_protocol:
             bind_addr = spec.virtual_ip
             daemon_spec.port_ips = {str(port): spec.virtual_ip}
         else:
@@ -132,6 +132,8 @@ class NFSService(CephService):
             }
             if spec.enable_haproxy_protocol:
                 context["haproxy_hosts"] = self._haproxy_hosts()
+                if spec.virtual_ip:
+                    context["haproxy_hosts"].append(spec.virtual_ip)
                 logger.debug("selected haproxy_hosts: %r", context["haproxy_hosts"])
             return self.mgr.template.render('services/nfs/ganesha.conf.j2', context)
 
index ed5b40a442fa7939e33e5078c896f592c9ca7624..85b7ed42f969b996016c427d4c93857bf23d6091 100644 (file)
@@ -84,11 +84,12 @@ class NFSCluster:
             virtual_ip_for_ganesha: Optional[str] = None
             keepalive_only: bool = False
             enable_haproxy_protocol: bool = False
+            if ingress_mode != IngressType.haproxy_standard:
+                virtual_ip_for_ganesha = virtual_ip.split('/')[0]
             if ingress_mode == IngressType.haproxy_protocol:
                 enable_haproxy_protocol = True
             elif ingress_mode == IngressType.keepalive_only:
                 keepalive_only = True
-                virtual_ip_for_ganesha = virtual_ip.split('/')[0]
                 ganesha_port = port
                 frontend_port = None