Skip to content

Commit c8dea4b

Browse files
committed
doc/cephadm: updating certmgr docs to reflects new changes
Signed-off-by: Redouane Kachach <[email protected]>
1 parent 9302801 commit c8dea4b

File tree

1 file changed

+82
-70
lines changed

1 file changed

+82
-70
lines changed

doc/cephadm/certmgr.rst

Lines changed: 82 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Certificate Management
77
Introduction
88
============
99

10-
Cephadm `certmgr` acts as the Root Certificate Authority (CA) for all
10+
Cephadm ``certmgr`` acts as the Root Certificate Authority (CA) for all
1111
self-signed certificates generated by Cephadm. For services that require
1212
SSL, admins have the option to either bring their own certificate or allow
1313
Cephadm to generate a self-signed certificate. This ensures secure communication
@@ -16,27 +16,25 @@ while offering flexibility for deployment preferences.
1616
Certificate Management Behavior
1717
===============================
1818

19-
Cephadm `certmgr` automatically detects whether a certificate is self-signed
20-
(generated by Cephadm) or user-provided. This distinction determines how it
21-
handles expirations and renewals:
19+
Cephadm ``certmgr`` automatically detects whether a certificate is self-signed (generated
20+
by Cephadm) or user-provided as an embedded value in the spec, or referenced externally.
21+
This distinction determines how it handles expirations and renewals:
2222

2323
Self-Signed Certificates
2424
------------------------
25-
- `certmgr` can fully automate renewal, ensuring seamless service operation.
25+
- ``certmgr`` can fully automate renewal, ensuring seamless service operation.
2626
- Automation is controlled by configuration parameters defining certificate
2727
duration, renewal thresholds, and whether automated rotation is enabled.
2828

2929
User-Provided Certificates
3030
--------------------------
31-
- `certmgr` does not renew these automatically but continuously monitors
32-
their status.
33-
- If an issue is detected (e.g., expiration is approaching), it issues
34-
health warnings/errors `CEPHADM_CERT_ERROR` to alert administrators,
35-
who must manually replace the certificate.
3631

37-
This proactive approach ensures secure and uninterrupted service operations
38-
while allowing users to manage certificate policies according to their needs.
32+
There are two types:
3933

34+
- Inline: Certificates embedded in the service spec; cannot be modified directly via ``certmgr``.
35+
- Reference: Certificates set and managed via ``certmgr``; must be manually uploaded.
36+
37+
See `Certificate Health Monitoring`_ for details on how ``certmgr`` handles user-provided certificate expiration.
4038

4139
Configuration
4240
=============
@@ -76,81 +74,96 @@ certificate lifecycle and renewal:
7674
Certificate Health Monitoring
7775
=============================
7876

79-
Cephadm continuously monitors the status of managed certificates. If any
80-
certificate is found to be invalid or expired, Cephadm will issue a health error
81-
with the code `CEPHADM_CERT_ERROR`. Additionally, if a certificate is
82-
approaching its expiration date, Cephadm will generate a health warning. This
83-
proactive alerting mechanism helps administrators take timely action to renew or
84-
replace certificates before service disruptions occur.
77+
Cephadm continuously monitors the status of all managed certificates, both self-signed and user-provided.
8578

79+
- If a certificate is invalid or has already expired, Cephadm issues a health
80+
error (``CEPHADM_CERT_ERROR``) to alert administrators.
81+
- If a certificate is approaching its expiration date, as determined by the
82+
configured ``mgr/cephadm/certificate_renewal_threshold_days``, Cephadm issues a
83+
health warning.
8684

87-
Known Certificates and Keys
88-
===========================
85+
Self-signed certificates are automatically renewed by Cephadm if automation is enabled, but
86+
user-provided certificates cannot be renewed automatically. In either case, Cephadm alerts
87+
administrators so they can take timely action. This proactive monitoring helps ensure
88+
uninterrupted service operation while giving users control over their certificate policies.
89+
90+
Spec Fields for SSL Configuration
91+
=================================
8992

90-
The `CertMgr` class maintains a list of known certificates and keys. These are
91-
automatically documented below:
93+
All service specs that support SSL/TLS may optionally define the following fields:
9294

93-
.. automodule:: mgr.cephadm.cert_mgr
94-
:members: known_certs, known_keys
95-
:undoc-members:
96-
:show-inheritance:
95+
- ``ssl``: Boolean to enable/disable SSL.
96+
- ``ssl_cert``: Certificate content (for ``inline``) or name (for ``reference``).
97+
- ``ssl_key``: Key content (for ``inline``) or name (for ``reference``).
98+
- ``certificate_source``: One of ``inline``, ``reference``, or ``cephadm_signed``.
99+
100+
If ``certificate_source`` is ``reference`` and the certificate is missing, users will need
101+
to upload the certificate by using the following ``certmgr`` command:
102+
103+
.. prompt:: bash #
104+
105+
ceph orch certmgr cert set --cert-name <cert-name> --service-name <service-name> -i <cert-key-pem-file>
97106

98107

99108
Certificate Scopes
100109
==================
101110

102-
Cephadm certmgr supports three different scopes for certificate management:
111+
Cephadm ``certmgr`` supports three different scopes for certificate management:
112+
113+
#. **Global Scope:**
103114

104-
1. **Global Scope:**
105115
- Certificates in this scope are shared across all service daemons, regardless of which host they are running on.
106-
- Example: `mgmt-gateway` certificate is a globally shared certificate used by all service daemons.
116+
- Example: ``mgmt-gateway`` certificate is a globally shared certificate used by all service daemons.
117+
118+
#. **Per-Host Scope:**
107119

108-
2. **Per-Host Scope:**
109120
- Certificates are assigned per host, meaning each host has its own unique certificate.
110121
- When configuring a custom certificate, the user must specify the host for which the certificate applies.
111-
- Example: `grafana` service cerificates are configured at the host level and applies specifically to a single machine.
122+
- Example: ``grafana`` service certificates are configured at the host level and apply specifically to a single machine.
112123

113-
3. **Per-Service Scope:**
114-
- Certificates are configured per service name, meaning each instance of a service can have its own certificate.
124+
#. **Per-Service Scope:**
125+
126+
- Certificates are configured per service name (each service instance can have its own certificate).
115127
- When specifying a custom certificate, the user must define the service to which it belongs.
116-
- Example: an `rgw` service certificate is assigned specifically and only to an RGW service
128+
- Example: an ``rgw`` service certificate is assigned specifically and only to an RGW service
117129

118130

119-
Reloading Certificate Manager
120-
=============================
131+
Listing Certificates
132+
====================
121133

122-
Run the following command to reload the certificate manager configuration from the Monitors:
134+
To list all certificates managed by Cephadm:
123135

124136
.. prompt:: bash #
125137

126-
ceph orch certmgr reload
138+
ceph orch certmgr cert ls [--show-details] [--include-cephadm-signed] [--filter-by <expression>]
127139

128-
This command ensures that any changes made to certificate configurations are
129-
applied immediately without requiring a service restart.
140+
This command displays an overview of all certificates currently managed by
141+
Cephadm. The ``--show-details`` option includes additional information such as
142+
issuing authorities and certificate extensions.
130143

131-
Listing Certificates
132-
====================
144+
By default, this command omits Cephadm-signed certificates. To include them,
145+
pass the ``--include-cephadm-signed`` argument.
133146

134-
To list all available certificates managed by the orchestrator:
147+
Examples:
135148

136149
.. prompt:: bash #
137150

138-
ceph orch certmgr cert ls [--show-details]
139-
140-
This command displays an overview of all certificates currently managed by
141-
cephadm. Using ``--show-details`` provides additional information, including issuing
142-
authorities and certificate extensions.
151+
ceph orch certmgr cert ls --include-cephadm-signed
152+
ceph orch certmgr cert ls --filter-by "status=expired"
153+
ceph orch certmgr cert ls --filter-by "scope=service,status=expiring"
154+
ceph orch certmgr cert ls --include-cephadm-signed --filter-by "name=rgw*,status=valid"
143155

144156
Listing Entities
145157
================
146158

147-
To list all entities associated with certificates:
159+
Displays all entities that are associated with managed certificates.
148160

149161
.. prompt:: bash #
150162

151-
ceph orch certmgr entity ls
163+
ceph orch certmgr bindings ls
152164

153-
Entities represent services that utilize managed certificates.
165+
List all current certificate bindings between consumers (services) and
166+
the certificates/keys managed by certmgr.
154167

155168
Checking Certificate Status
156169
===========================
@@ -170,9 +183,10 @@ To list all private keys associated with managed certificates:
170183

171184
.. prompt:: bash #
172185

173-
ceph orch certmgr key ls
186+
ceph orch certmgr key ls [--include-cephadm-signed]
174187

175-
This command shows which keys are currently managed by cephadm.
188+
This command shows which keys are currently managed by cephadm. By default, this command omits
189+
Cephadm-signed keys. To include them, pass the ``--include-cephadm-signed`` argument.
176190

177191
Retrieving a Certificate
178192
========================
@@ -183,9 +197,8 @@ To retrieve the content of a specific certificate:
183197

184198
ceph orch certmgr cert get <certificate_name> [--service_name <value>] [--hostname <value>] [--no-exception-when-missing]
185199

186-
Replace `<certificate-name>` with the actual certificate name from `ceph
187-
orch certmgr cert ls`. For certificates with host or service scope, include
188-
the `--hostname` or `--service_name` arguments as needed.
200+
Use ``<service-name>`` as listed by ``ceph orch certmgr bindings ls``. For certificates with host or service scope,
201+
include the ``--hostname`` or ``--service_name`` arguments as needed.
189202

190203
Retrieving a Certificate Key
191204
============================
@@ -196,9 +209,9 @@ To retrieve the private key associated with a specific certificate:
196209

197210
ceph orch certmgr key get <key_name> [--service_name <value>] [--hostname <value>] [--no-exception-when-missing]
198211

199-
Replace `<key-name>` with the actual certificate name from `ceph
200-
orch certmgr key ls`. For certificates with host or service scope, include
201-
the `--hostname` or `--service_name` arguments as needed.
212+
Replace ``<key-name>`` with the actual certificate name from ``ceph orch certmgr key ls``.
213+
For certificates with host or service scope, include
214+
the ``--hostname`` or ``--service_name`` arguments as needed.
202215

203216
Setting a Certificate-Key Pair
204217
==============================
@@ -207,14 +220,12 @@ To associate a certificate with a private key:
207220

208221
.. prompt:: bash #
209222

210-
ceph orch certmgr cert-key set <entity> [--cert <value>] [--key <value>] [--service_name <value>] [--hostname <value>] [-i <cert-key-path>] [--force]
223+
ceph orch certmgr cert-key set <service-type> [--cert <value>] [--key <value>] [--service_name <value>] [--hostname <value>] [-i <cert-key-path>] [--force]
211224

212-
Use this command to upload or replace an existing certificate/key pair
213-
for a certain service. Replace `<entity-name>` with the actual
214-
certificate name from `ceph orch certmgr entity ls`. The -i option
215-
can be used to specify a file containing a combined certificate and
216-
key in PEM format. This file should include both the certificate and
217-
private key concatenated together.
225+
Use this command to upload or replace an existing certificate/key pair for a certain service.
226+
Replace ``<service-type>`` with the actual certificate name from ``ceph orch certmgr bindings ls``.
227+
The ``-i`` option can be used to specify a file containing a combined certificate and key in
228+
PEM format. This file should include both the certificate and private key concatenated together.
218229

219230
Setting a Certificate
220231
=====================
@@ -247,7 +258,7 @@ To remove an existing certificate:
247258

248259
ceph orch certmgr cert rm <certificate_name> [--service_name <value>] [--hostname <value>]
249260

250-
**Note:** For certificates with host or service scope, use the `--service-name` or `--hostname` option to specify the target.
261+
**Note:** For certificates with host or service scope, use the ``--service-name`` or ``--hostname`` option to specify the target.
251262

252263
``<certificate_name>`` must be a valid certificate name. Use ``ceph orch certmgr cert ls`` to list supported certificates.
253264

@@ -260,7 +271,7 @@ To remove an existing private key:
260271

261272
ceph orch certmgr key rm <key-name> [--service_name <value>] [--hostname <value>]
262273

263-
**Note:** For keys with host or service scope, use the `--service-name` or `--hostname` option to specify the target.
274+
**Note:** For keys with host or service scope, use the ``--service-name`` or ``--hostname`` option to specify the target.
264275

265276
``<key_name>`` must be a valid key name. Use ``ceph orch certmgr key ls`` to list supported keys.
266277

@@ -271,6 +282,7 @@ To automatically generate a new certificate and key pair:
271282

272283
.. prompt:: bash #
273284

274-
cehp orch certmgr generate-certificates <module_name>
285+
ceph orch certmgr generate-certificates <module_name>
275286

276-
This command provisions new certificates for specified Manager module.
287+
This command provisions new certificates for specified Manager ``module``. It is typically used
288+
for the specified modules that require automatic TLS provisioning (e.g., dashboard).

0 commit comments

Comments
 (0)