Skip to content

Commit 7af22ba

Browse files
author
Omid Yoosefi
committed
pybind/mgr/cephadm: allow setting custom monitoring_port for nfs
ganesha config allows this, so allow users to set their own custom ports in case they wish to do so. Signed-off-by: Omid Yoosefi <[email protected]>
1 parent 880c3db commit 7af22ba

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def get_ganesha_conf() -> str:
118118
"url": f'rados://{POOL_NAME}/{spec.service_id}/{spec.rados_config_name()}',
119119
# fall back to default NFS port if not present in daemon_spec
120120
"port": daemon_spec.ports[0] if daemon_spec.ports else 2049,
121+
"monitoring_port": spec.monitoring_port if spec.monitoring_port else 9587,
121122
"bind_addr": bind_addr,
122123
"haproxy_hosts": [],
123124
"nfs_idmap_conf": nfs_idmap_conf,

src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ NFS_CORE_PARAM {
1313
{% if haproxy_hosts %}
1414
HAProxy_Hosts = {{ haproxy_hosts|join(", ") }};
1515
{% endif %}
16+
Monitoring_Port = {{ monitoring_port }};
1617
}
1718

1819
NFSv4 {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,6 +3286,7 @@ def fake_keys():
32863286
' NFS_Port = 2049;\n'
32873287
' allow_set_io_flusher_fail = true;\n'
32883288
' HAProxy_Hosts = 192.168.122.111, 10.10.2.20, 192.168.122.222;\n'
3289+
' Monitoring_Port = 9587;\n'
32893290
'}\n'
32903291
'\n'
32913292
'NFSv4 {\n'

src/python-common/ceph/deployment/service_spec.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ def __init__(self,
11411141
config: Optional[Dict[str, str]] = None,
11421142
networks: Optional[List[str]] = None,
11431143
port: Optional[int] = None,
1144+
monitoring_port: Optional[int] = None,
11441145
virtual_ip: Optional[str] = None,
11451146
enable_nlm: bool = False,
11461147
enable_haproxy_protocol: bool = False,
@@ -1157,6 +1158,7 @@ def __init__(self,
11571158
extra_entrypoint_args=extra_entrypoint_args, custom_configs=custom_configs)
11581159

11591160
self.port = port
1161+
self.monitoring_port = monitoring_port
11601162
self.virtual_ip = virtual_ip
11611163
self.enable_haproxy_protocol = enable_haproxy_protocol
11621164
self.idmap_conf = idmap_conf

0 commit comments

Comments
 (0)