]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm/services/ingress make HAProxy to listen on IPv4 and IPv6 by default 55883/head
authorBernard Landon <bernard@lndn.ch>
Fri, 1 Mar 2024 21:18:32 +0000 (22:18 +0100)
committerBernard Landon <bernard@lndn.ch>
Wed, 6 Mar 2024 21:44:27 +0000 (22:44 +0100)
By default, HAProxy will only bind to IPv4 addresses preventing the ingress
service to be used in dual stack or mixed IPv4/IPv6 environments.
This patch changes the default so HAProxy would bind both on IPv4 and IPv6 addresses.

Signed-off-by: Bernard Landon <bernard@lndn.ch>
src/pybind/mgr/cephadm/services/ingress.py
src/pybind/mgr/cephadm/tests/test_services.py

index 55be3045466abe3c9d130b2cabc8c871bec2fb73..ad6729049122ed408ec137ed4a320de062da74c3 100644 (file)
@@ -169,9 +169,9 @@ class IngressService(CephService):
         if spec.enable_haproxy_protocol:
             server_opts.append("send-proxy-v2")
         logger.debug("enabled default server opts: %r", server_opts)
-        ip = '*' if spec.virtual_ips_list else str(spec.virtual_ip).split('/')[0] or daemon_spec.ip or '*'
+        ip = '[..]' if spec.virtual_ips_list else str(spec.virtual_ip).split('/')[0] or daemon_spec.ip or '[..]'
         frontend_port = daemon_spec.ports[0] if daemon_spec.ports else spec.frontend_port
-        if ip != '*' and frontend_port:
+        if ip != '[..]' and frontend_port:
             daemon_spec.port_ips = {str(frontend_port): ip}
         haproxy_conf = self.mgr.template.render(
             'services/ingress/haproxy.cfg.j2',
index f0b5360e6e30e202bc76a44caee06e4586f0e583..c716d7d182f00e8d27ff6725cd31be1bd6a46441 100644 (file)
@@ -2053,7 +2053,7 @@ class TestIngressService:
                                 'maxconn                 8000\n'
                                 '\nfrontend stats\n    '
                                 'mode http\n    '
-                                'bind *:8999\n    '
+                                'bind [..]:8999\n    '
                                 'bind 1.2.3.7:8999\n    '
                                 'stats enable\n    '
                                 'stats uri /stats\n    '
@@ -2062,7 +2062,7 @@ class TestIngressService:
                                 'http-request use-service prometheus-exporter if { path /metrics }\n    '
                                 'monitor-uri /health\n'
                                 '\nfrontend frontend\n    '
-                                'bind *:8089\n    '
+                                'bind [..]:8089\n    '
                                 'default_backend backend\n\n'
                                 'backend backend\n    '
                                 'option forwardfor\n    '