From: Shweta Bhosale Date: Mon, 21 Apr 2025 06:40:58 +0000 (+0530) Subject: mgr/nfs: Add VIP to HAProxy_Hosts list for imgress type haproxy-protocol X-Git-Tag: v20.0.0-pre.ibm~36^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cb56b040d68728147b869eb63ab7c5cb52b86735;p=ceph-ci.git mgr/nfs: Add VIP to HAProxy_Hosts list for imgress type haproxy-protocol Fixes: https://tracker.ceph.com/issues/70985 Signed-off-by: Shweta Bhosale (cherry picked from commit 76f10dbc1fd01ef5046c9f8a6a3990ad87016b17) --- diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index 933d980886b..b695fa0b44c 100644 --- a/src/pybind/mgr/cephadm/services/nfs.py +++ b/src/pybind/mgr/cephadm/services/nfs.py @@ -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) diff --git a/src/pybind/mgr/nfs/cluster.py b/src/pybind/mgr/nfs/cluster.py index ed5b40a442f..85b7ed42f96 100644 --- a/src/pybind/mgr/nfs/cluster.py +++ b/src/pybind/mgr/nfs/cluster.py @@ -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