mgr/cephadm: add enable_haproxy_protocol to ingress and nfs service specs

Add a new boolean field, enable_haproxy_protocol, to both the ingress
service spec and the nfs service spec. The ingress service spec needs
the field to tell haproxy to enable proxy protocol (v2) support.
The nfs service spec needs the field to allow the nfs server to accept
proxy protocol messages.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2023-03-21 11:42:25 -04:00
parent 7c7b7b6721
commit 5691def1f8

View File

@ -811,6 +811,7 @@ class NFSServiceSpec(ServiceSpec):
networks: Optional[List[str]] = None,
port: Optional[int] = None,
virtual_ip: Optional[str] = None,
enable_haproxy_protocol: bool = False,
extra_container_args: Optional[List[str]] = None,
extra_entrypoint_args: Optional[List[str]] = None,
custom_configs: Optional[List[CustomConfig]] = None,
@ -824,6 +825,7 @@ class NFSServiceSpec(ServiceSpec):
self.port = port
self.virtual_ip = virtual_ip
self.enable_haproxy_protocol = enable_haproxy_protocol
def get_port_start(self) -> List[int]:
if self.port:
@ -1054,6 +1056,7 @@ class IngressSpec(ServiceSpec):
unmanaged: bool = False,
ssl: bool = False,
keepalive_only: bool = False,
enable_haproxy_protocol: bool = False,
extra_container_args: Optional[List[str]] = None,
extra_entrypoint_args: Optional[List[str]] = None,
custom_configs: Optional[List[CustomConfig]] = None,
@ -1085,6 +1088,7 @@ class IngressSpec(ServiceSpec):
self.unmanaged = unmanaged
self.ssl = ssl
self.keepalive_only = keepalive_only
self.enable_haproxy_protocol = enable_haproxy_protocol
def get_port_start(self) -> List[int]:
ports = []