Skip to content

Commit d4e08bf

Browse files
cephadm: don't add --publish options to clustered instances
Clustered instances use host networking (for reasons) and nothing benefits from having --publish options in the container cli doing nothing and possibly being misleading (as there could be way more ports bound than the container runtime shows). Signed-off-by: John Mulligan <[email protected]>
1 parent 77b0412 commit d4e08bf

File tree

1 file changed

+11
-5
lines changed
  • src/cephadm/cephadmlib/daemons

1 file changed

+11
-5
lines changed

src/cephadm/cephadmlib/daemons/smb.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,17 @@ def args(self) -> List[str]:
225225

226226
def container_args(self) -> List[str]:
227227
cargs = []
228-
if self.cfg.smb_port:
229-
cargs.append(f'--publish={self.cfg.smb_port}:{Ports.SMB.value}')
230-
if self.cfg.metrics_port:
231-
metrics_port = self.cfg.metrics_port
232-
cargs.append(f'--publish={metrics_port}:{metrics_port}')
228+
if not self.cfg.clustered:
229+
# if we are not clustered we use container networking (vs. host
230+
# networking) and need to publish ports via podman/docker.
231+
# All published ports happen at the primary container.
232+
if self.cfg.smb_port:
233+
cargs.append(
234+
f'--publish={self.cfg.smb_port}:{Ports.SMB.value}'
235+
)
236+
if self.cfg.metrics_port:
237+
metrics_port = self.cfg.metrics_port
238+
cargs.append(f'--publish={metrics_port}:{metrics_port}')
233239
cargs.extend(_container_dns_args(self.cfg))
234240
return cargs
235241

0 commit comments

Comments
 (0)