From 2e743c3c2ad1a3d10f38ee226d1a8a8417ba30ae Mon Sep 17 00:00:00 2001 From: Shweta Bhosale Date: Wed, 25 Mar 2026 15:59:40 +0530 Subject: [PATCH] mgr/cephadm: Handled stick table for ipv6 setup, also removed stick table expiry Fixes: https://tracker.ceph.com/issues/74970 Signed-off-by: Shweta Bhosale --- src/pybind/mgr/cephadm/services/ingress.py | 2 ++ .../mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 | 7 ++++++- src/pybind/mgr/cephadm/tests/services/test_ingress.py | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/cephadm/services/ingress.py b/src/pybind/mgr/cephadm/services/ingress.py index 59288256aa5f..be4f2119ecc0 100644 --- a/src/pybind/mgr/cephadm/services/ingress.py +++ b/src/pybind/mgr/cephadm/services/ingress.py @@ -5,6 +5,7 @@ import string from typing import List, Dict, Any, Tuple, cast, Optional, TYPE_CHECKING from ceph.deployment.service_spec import ServiceSpec, IngressSpec, MonitorCertSource +from ceph.deployment.utils import is_ipv6 from mgr_util import build_url from cephadm import utils from orchestrator import OrchestratorError, DaemonDescription @@ -275,6 +276,7 @@ class IngressService(CephService): 'v4v6_flag': v4v6_flag, 'monitor_ssl_file': monitor_ssl_file, 'peer_hosts': peer_hosts, + 'is_ipv6': is_ipv6(ip) } ) config_files = { diff --git a/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 b/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 index eb506436da32..6d00f4e975f1 100644 --- a/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 +++ b/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 @@ -96,7 +96,12 @@ backend backend mode tcp balance roundrobin {% if backend_spec.service_type == 'nfs' %} - stick-table type ip size 1m expire 2h store server_id peers haproxy_peers + {% if is_ipv6 or v4v6_flag %} + stick-table type ipv6 size 1m store server_id peers haproxy_peers + {% endif %} + {% if not is_ipv6 or v4v6_flag %} + stick-table type ip size 1m store server_id peers haproxy_peers + {% endif %} stick match src stick store-request src option tcp-check diff --git a/src/pybind/mgr/cephadm/tests/services/test_ingress.py b/src/pybind/mgr/cephadm/tests/services/test_ingress.py index 869bb160079f..e3bef3d45445 100644 --- a/src/pybind/mgr/cephadm/tests/services/test_ingress.py +++ b/src/pybind/mgr/cephadm/tests/services/test_ingress.py @@ -126,7 +126,7 @@ class TestIngressService: 'backend backend\n' ' mode tcp\n' ' balance roundrobin\n' - ' stick-table type ip size 1m expire 2h store server_id peers haproxy_peers\n' + ' stick-table type ip size 1m store server_id peers haproxy_peers\n' ' stick match src\n' ' stick store-request src\n' ' option tcp-check\n' @@ -1168,7 +1168,7 @@ class TestIngressService: 'backend backend\n' ' mode tcp\n' ' balance roundrobin\n' - ' stick-table type ip size 1m expire 2h store server_id peers haproxy_peers\n' + ' stick-table type ip size 1m store server_id peers haproxy_peers\n' ' stick match src\n' ' stick store-request src\n' ' option tcp-check\n' -- 2.47.3