Skip to content

Commit 9487685

Browse files
authored
Merge pull request ceph#62891 from ShwetaBhosale1/fix_issue_70985_nfs_add_vip_in_HAProxy_Hosts_list
mgr/nfs: Add VIP to HAProxy_Hosts list for ingress type haproxy-protocol Reviewed-by: Adam King <[email protected]>
2 parents b57e0f0 + 76f10db commit 9487685

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def generate_config(self, daemon_spec: CephadmDaemonDeploySpec) -> Tuple[Dict[st
102102
# create the RGW keyring
103103
rgw_user = f'{rados_user}-rgw'
104104
rgw_keyring = self.create_rgw_keyring(daemon_spec)
105-
if spec.virtual_ip:
105+
if spec.virtual_ip and not spec.enable_haproxy_protocol:
106106
bind_addr = spec.virtual_ip
107107
daemon_spec.port_ips = {str(port): spec.virtual_ip}
108108
else:
@@ -132,6 +132,8 @@ def get_ganesha_conf() -> str:
132132
}
133133
if spec.enable_haproxy_protocol:
134134
context["haproxy_hosts"] = self._haproxy_hosts()
135+
if spec.virtual_ip:
136+
context["haproxy_hosts"].append(spec.virtual_ip)
135137
logger.debug("selected haproxy_hosts: %r", context["haproxy_hosts"])
136138
return self.mgr.template.render('services/nfs/ganesha.conf.j2', context)
137139

src/pybind/mgr/nfs/cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ def _call_orch_apply_nfs(
8484
virtual_ip_for_ganesha: Optional[str] = None
8585
keepalive_only: bool = False
8686
enable_haproxy_protocol: bool = False
87+
if ingress_mode != IngressType.haproxy_standard:
88+
virtual_ip_for_ganesha = virtual_ip.split('/')[0]
8789
if ingress_mode == IngressType.haproxy_protocol:
8890
enable_haproxy_protocol = True
8991
elif ingress_mode == IngressType.keepalive_only:
9092
keepalive_only = True
91-
virtual_ip_for_ganesha = virtual_ip.split('/')[0]
9293
ganesha_port = port
9394
frontend_port = None
9495

0 commit comments

Comments
 (0)