]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/cephadm: don't remove TLS certs if svc still has daemons on host
authorRedouane Kachach <rkachach@ibm.com>
Fri, 14 Nov 2025 12:06:59 +0000 (13:06 +0100)
committerRedouane Kachach <rkachach@ibm.com>
Fri, 14 Nov 2025 16:07:44 +0000 (17:07 +0100)
commita9ee38bff2b79ebf12e9894690705036936aad46
tree254cf7a7337037bd7afb2e38dabb133dc8dfc4a1
parent5e6cfcfc6f851359a17cdf96cbbb46783d3d0ac7
mgr/cephadm: don't remove TLS certs if svc still has daemons on host

This change fixes an issue in cephadm where cephadm-signed (and
inline) TLS certificates could be removed while a service was still
running on the same host. During a rolling transition from HTTP to
HTTPS (e.g. RGW moving from port 80 to 443 with ssl: true), the
previous post_remove() logic deletes the service’s cephadm-signed
cert/key as soon as any daemon is removed, even if a new HTTPS daemon
for the same service is being deployed on that host. In practice this
leads to the certificate being created for the new daemon and then
immediately deleted from the certmgr store.

The new behavior makes post_remove() more conservative: before
removing a cephadm-signed or inline certificate, it checks whether
there are any remaining daemons for that service on the same host. If
there are, the cert/key is left in place because it may still be in
use (for example during an HTTP->HTTPS rollout). Certificates are only
cleaned up once the last daemon for that service disappears from the
host (and, when the service no longer uses SSL). This preserves
correct TLS behavior during service transitions while still
ensuring certificates are eventually garbage-collected when no longer
needed.

Fixes: https://tracker.ceph.com/issues/73853
Resolves: rhbz#2408795

Signed-off-by: Redouane Kachach <rkachach@ibm.com>
src/pybind/mgr/cephadm/cert_mgr.py
src/pybind/mgr/cephadm/services/cephadmservice.py
src/pybind/mgr/cephadm/tlsobject_store.py