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
'v4v6_flag': v4v6_flag,
'monitor_ssl_file': monitor_ssl_file,
'peer_hosts': peer_hosts,
+ 'is_ipv6': is_ipv6(ip)
}
)
config_files = {
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
'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'
'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'