From: John Mulligan Date: Thu, 12 Jun 2025 18:58:18 +0000 (-0400) Subject: cephadm: don't add --publish options to clustered instances X-Git-Tag: v20.1.0~42^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=67d0511d4e2793635cfeb6f34963e68188303817;p=ceph.git 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 (cherry picked from commit d4e08bf9ede3c5289e2cf0b9921de1082d7131c6) --- diff --git a/src/cephadm/cephadmlib/daemons/smb.py b/src/cephadm/cephadmlib/daemons/smb.py index de2356c21d9d..891e01e112a9 100644 --- a/src/cephadm/cephadmlib/daemons/smb.py +++ b/src/cephadm/cephadmlib/daemons/smb.py @@ -225,11 +225,17 @@ class SMBDContainer(SambaContainerCommon): def container_args(self) -> List[str]: cargs = [] - if self.cfg.smb_port: - cargs.append(f'--publish={self.cfg.smb_port}:{Ports.SMB.value}') - if self.cfg.metrics_port: - metrics_port = self.cfg.metrics_port - cargs.append(f'--publish={metrics_port}:{metrics_port}') + if not self.cfg.clustered: + # if we are not clustered we use container networking (vs. host + # networking) and need to publish ports via podman/docker. + # All published ports happen at the primary container. + if self.cfg.smb_port: + cargs.append( + f'--publish={self.cfg.smb_port}:{Ports.SMB.value}' + ) + if self.cfg.metrics_port: + metrics_port = self.cfg.metrics_port + cargs.append(f'--publish={metrics_port}:{metrics_port}') cargs.extend(_container_dns_args(self.cfg)) return cargs