Skip to content

Commit 81c54dd

Browse files
committed
mgr/cephadm: fixing docs and defaults for some options
Signed-off-by: Redouane Kachach <[email protected]>
1 parent eae45d2 commit 81c54dd

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

doc/cephadm/certmgr.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ and applies renewal policies based on the certificate type and configured
4646
parameters. Cephadm provides several configuration options to manage certificate
4747
lifecycle and renewal:
4848

49-
- **`mgr/cephadm/certificate_automated_rotation_enabled`** (default: `False`):
50-
Disabled by default, this configuration option controls
49+
- **`mgr/cephadm/certificate_automated_rotation_enabled`** (default: `True`):
50+
Enabled by default, this configuration option controls
5151
whether Cephadm automatically rotates certificates upon expiration. This helps
5252
ensure continuity and security without manual intervention. When disabled cephadm will
5353
still check periodically the certificates but instead of automatically renewing self-signed
@@ -58,14 +58,18 @@ lifecycle and renewal:
5858
and signed by the Cephadm root CA. This determines the validity period before
5959
renewal is required.
6060

61-
- **`certificate_renewal_threshold_days`** (default: `30`, min: `10`, max:
61+
- **`mgr/cephadm/certificate_renewal_threshold_days`** (default: `30`, min: `10`, max:
6262
`90`): Defines the number of days before a certificate's expiration when
6363
Cephadm should initiate renewal. This ensures timely replacement before
6464
expiration occurs. This applies to both self-signed and user-provided
6565
certificates. In the case of user-provided certificates, Cephadm will issue a
6666
health error or warning alerting administrators about the upcoming renewal
6767
period proximity.
6868

69+
- **`mgr/cephadm/certificate_check_period`** (default: `1`, min: `0`, max: `30`):
70+
Specifies how often (in days) the certificate should be checked for validity.
71+
This ensures timely detection of any issues related to certificate expiration.
72+
Setting this to `0` disables the certificate check functionality.
6973

7074
Certificate Health Monitoring
7175
=============================
@@ -201,11 +205,14 @@ To associate a certificate with a private key:
201205

202206
.. prompt:: bash #
203207

204-
ceph orch certmgr cert-key set <entity> [--cert <value>] [--key <value>] [--service_name <value>] [--hostname <value>] [--force]
208+
ceph orch certmgr cert-key set <entity> [--cert <value>] [--key <value>] [--service_name <value>] [--hostname <value>] [-i <cert-key-path>] [--force]
205209

206-
Use this command to upload or replace an existing certificate/key pair for a
207-
certain service. Replace `<entiy-name>` with the actual certificate name from
208-
`ceph orch certmgr entity ls`.
210+
Use this command to upload or replace an existing certificate/key pair
211+
for a certain service. Replace `<entity-name>` with the actual
212+
certificate name from `ceph orch certmgr entity ls`. The -i option
213+
can be used to specify a file containing a combined certificate and
214+
key in PEM format. This file should include both the certificate and
215+
private key concatenated together.
209216

210217
Setting a Certificate
211218
=====================

src/pybind/mgr/cephadm/module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,16 +413,16 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
413413
Option(
414414
'certificate_automated_rotation_enabled',
415415
type='bool',
416-
default=False,
416+
default=True,
417417
desc='This flag controls whether cephadm automatically rotates certificates upon expiration.',
418418
),
419419
Option(
420420
'certificate_check_period',
421421
type='int',
422422
default=1, # Default to checking certificates once per day
423423
desc='Specifies how often (in days) the certificate should be checked for validity.',
424-
min=1,
425-
max=3, # must be lesr than min of certificate_renewal_threshold_days
424+
min=0, # 0 will disable the certificate checking
425+
max=30, # must be less than the min of certificate_renewal_threshold_days.
426426
),
427427
Option(
428428
'certificate_duration_days',

src/pybind/mgr/cephadm/serve.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ def serve(self) -> None:
142142

143143
def _check_certificates(self) -> None:
144144

145+
if self.mgr.certificate_check_period == 0:
146+
# certificate check has been disabled by the user
147+
return
148+
145149
# Check certificates if:
146150
# - This is the first time (startup, last_certificates_check is None)
147151
# - Or the elapsed time is greater than or equal to the configured check period

0 commit comments

Comments
 (0)