Skip to content

Commit 216980f

Browse files
authored
Merge pull request ceph#58298 from thegreenbear/cephadm-ingress-fix-ipv6-binding
Ingress service: Fix HAProxy to listen on IPv4 and IPv6 Reviewed-by: Adam King <[email protected]>
2 parents 029b4ea + afacfa8 commit 216980f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ def haproxy_generate_config(
169169
if spec.enable_haproxy_protocol:
170170
server_opts.append("send-proxy-v2")
171171
logger.debug("enabled default server opts: %r", server_opts)
172-
ip = '[..]' if spec.virtual_ips_list else str(spec.virtual_ip).split('/')[0] or daemon_spec.ip or '[..]'
172+
ip = '[::]' if spec.virtual_ips_list else str(spec.virtual_ip).split('/')[0] or daemon_spec.ip or '[::]'
173173
frontend_port = daemon_spec.ports[0] if daemon_spec.ports else spec.frontend_port
174-
if ip != '[..]' and frontend_port:
174+
if ip != '[::]' and frontend_port:
175175
daemon_spec.port_ips = {str(frontend_port): ip}
176176
haproxy_conf = self.mgr.template.render(
177177
'services/ingress/haproxy.cfg.j2',

src/pybind/mgr/cephadm/tests/test_services.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@ def test_ingress_config_multi_vips(self, _run_cephadm, cephadm_module: CephadmOr
22092209
'maxconn 8000\n'
22102210
'\nfrontend stats\n '
22112211
'mode http\n '
2212-
'bind [..]:8999\n '
2212+
'bind [::]:8999\n '
22132213
'bind 1.2.3.7:8999\n '
22142214
'stats enable\n '
22152215
'stats uri /stats\n '
@@ -2218,7 +2218,7 @@ def test_ingress_config_multi_vips(self, _run_cephadm, cephadm_module: CephadmOr
22182218
'http-request use-service prometheus-exporter if { path /metrics }\n '
22192219
'monitor-uri /health\n'
22202220
'\nfrontend frontend\n '
2221-
'bind [..]:8089\n '
2221+
'bind [::]:8089\n '
22222222
'default_backend backend\n\n'
22232223
'backend backend\n '
22242224
'option forwardfor\n '

0 commit comments

Comments
 (0)