Skip to content

Commit a23bbbc

Browse files
authored
docs(certs): clarify maintenanceTimeWindows scope for custom certs (#11457)
Signed-off-by: prmellor <pmellor@redhat.com>
1 parent f031673 commit a23bbbc

File tree

2 files changed

+99
-50
lines changed

2 files changed

+99
-50
lines changed

documentation/modules/configuring/con-maintenance-time-window-definition.adoc

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,39 @@
66
= Scheduling maintenance time windows
77

88
[role="_abstract"]
9-
Schedule Cluster Operator certificate renewals for Kafka clusters to minimize impact on client applications.
10-
Use time windows in conjunction with the xref:con-certificate-renewal-str[renewal periods of the CA certificates created by the Cluster Operator] (`Kafka.spec.clusterCa.renewalDays` and `Kafka.spec.clientsCa.renewalDays`).
9+
Use maintenance time windows to control when the Cluster Operator performs certificate renewals and the related rolling restarts.
10+
This helps minimize disruption to Kafka clients by scheduling updates at convenient times.
1111

12-
Updates are usually triggered by changes to the `Kafka` resource by the user or through user tooling.
13-
Rolling restarts for certificate expiration may occur without `Kafka` resource changes.
14-
While unscheduled restarts shouldn't affect service availability, they could impact the performance of client applications.
15-
Maintenance time windows allow scheduling of these updates for convenient times.
12+
Maintenance time windows apply only to automatic certificate renewals and rolling restarts managed by the Cluster Operator.
13+
14+
They **apply** in the following scenarios:
15+
16+
* Automatic time-based renewal of Strimzi-managed internal certificates, such as those used by Kafka nodes.
17+
* Automatic time-based renewal of server certificates signed by a custom Certificate Authority (CA), _if_ Strimzi manages the renewal process based on certificate expiry.
18+
19+
They **do not apply** in the following scenarios:
20+
21+
* User-driven changes to the `Kafka` custom resource, including configuration updates.
22+
* Environment-driven changes to certificate fields, such as the Common Name (CN) or Subject Alternative Names (SANs). For example, when a new load balancer address is introduced.
23+
* Manual updates to Cluster CA or Clients CA certificates, even if they are Strimzi-managed, since these updates are treated as user-initiated actions.
24+
* Externally managed certificates, such as:
25+
** Custom listener certificates provided directly by the user.
26+
** Certificates issued by an external certificate manager.
27+
28+
In these cases, restarts may occur immediately and outside any configured maintenance time window.
29+
30+
Use time windows in conjunction with the xref:con-certificate-renewal-str[renewal periods for CA certificates] set in the `Kafka` resource (`Kafka.spec.clusterCa.renewalDays` and `Kafka.spec.clientsCa.renewalDays`).
31+
32+
Rolling restarts can be triggered in two ways:
33+
34+
* By user-driven changes to the `Kafka` custom resource
35+
* Automatically, when Cluster Operator-managed certificates near expiration
36+
37+
User-driven restarts are not restricted by maintenance time windows.
38+
However, automatically triggered restarts for expiring certificates are subject to the configured maintenance windows.
39+
40+
Although restarts typically do not affect service availability, they can temporarily impact client performance.
41+
Use maintenance time windows to schedule automatic restarts occur during periods of low client activity.
1642

1743
Configure maintenance time windows as follows:
1844

@@ -36,7 +62,7 @@ spec:
3662
#...
3763
----
3864

39-
NOTE: The Cluster Operator doesn't adhere strictly to the given time windows for maintenance operations.
65+
NOTE: The Cluster Operator doesn't adhere strictly to the time windows
4066
Maintenance operations are triggered by the first reconciliation that occurs within the specified time window.
4167
If the time window is shorter than the interval between reconciliations, there's a risk that the reconciliation may happen outside of the time window,
4268
Therefore, maintenance time windows must be at least as long as the interval between reconciliations.

documentation/modules/security/con-certificate-renewal.adoc

Lines changed: 66 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
= Certificate renewal and validity periods
77

88
[role="_abstract"]
9-
Cluster CA and clients CA certificates are only valid for a limited time period, known as the validity period.
10-
This is usually defined as a number of days since the certificate was generated.
9+
Cluster CA and clients CA certificates are valid for a limited time, known as the validity period.
10+
This is defined as the number of days from the date the certificate was generated.
1111

12-
For CA certificates automatically created by the Cluster Operator, configure the validity period for certificates in the `kafka` resource using the following properties:
12+
For CA certificates automatically created by the Cluster Operator, configure the validity period for certificates in the `kafka` resource:
1313

1414
* `Kafka.spec.clusterCa.validityDays` for Cluster CA certificates
1515
* `Kafka.spec.clientsCa.validityDays` for Clients CA certificates
1616

1717
The default validity period for both certificates is 365 days.
18-
Manually-installed CA certificates should have their own validity periods defined.
18+
For manually-installed custom CA certificates, set validity through your certificate management system.
1919

20-
When a CA certificate expires, components and clients that still trust that certificate do not accept connections from peers whose certificates were signed by the CA private key.
21-
The components and clients need to trust the _new_ CA certificate instead.
20+
When a CA certificate expires, components and clients that still trust the old certificate do not accept connections from peers whose certificates were signed by the CA private key.
21+
The components and clients must trust the _new_ CA certificate instead.
2222

23-
To allow the renewal of CA certificates without a loss of service, the Cluster Operator initiates certificate renewal before the old CA certificates expire.
23+
To prevent loss of service, the Cluster Operator initiates certificate renewal before the old CA certificates expire.
2424

2525
Configure the renewal period of the certificates created by the Cluster Operator in the `kafka` resource using the following properties:
2626

2727
* `Kafka.spec.clusterCa.renewalDays` for Cluster CA certificates
2828
* `Kafka.spec.clientsCa.renewalDays` for Clients CA certificates
2929

30-
The default renewal period for both certificates is 30 days.
31-
32-
The renewal period is measured backwards, from the expiry date of the current certificate.
30+
The default renewal period for both certificates is 30 days from the expiry date of the current certificate.
31+
Changing the `validityDays` does not trigger immediate certificate renewal.
32+
The updated value is applied the next time the certificate is renewed, either automatically or through manual renewal.
3333

3434
.Validity period against renewal period
3535
[source]
@@ -40,11 +40,20 @@ Not Before Not After
4040
<--- renewalDays --->|
4141
----
4242

43+
Changes to `renewalDays` may trigger renewal earlier if the new value places the certificate within the renewal window.
4344
To schedule the renewal period at a convenient time, use xref:con-maintenance-time-window-definition-{context}[maintenance time windows].
4445

45-
To make a change to the validity and renewal periods after creating the Kafka cluster, configure and apply the `Kafka` custom resource,
46-
and xref:proc-renewing-ca-certs-manually-{context}[manually renew the CA certificates].
47-
If you do not manually renew the certificates, the new periods will be used the next time the certificate is renewed automatically.
46+
IMPORTANT: `maintenanceTimeWindows` apply *only* to certificates generated automatically by the Cluster Operator.
47+
They do *not* apply to custom or externally managed certificates, so restarts triggered by updates to those certificates may occur outside the defined windows.
48+
With a custom Certificate Authority (CA), the Cluster Operator still manages the validity and renewal of the server certificates it generates.
49+
In this case, `validityDays` and `renewalDays` apply to those server certificates, not to the CA itself.
50+
51+
To change validity and renewal periods after creating the Kafka cluster:
52+
53+
. Modify the `Kafka` custom resource.
54+
. xref:proc-renewing-ca-certs-manually-{context}[Manually renew the CA certificates].
55+
56+
If you do not manually renew the certificates, the new settings take effect the next time the certificate is renewed automatically.
4857

4958
.Example Kafka configuration for certificate validity and renewal periods
5059
[source,yaml,subs="+quotes,attributes"]
@@ -65,52 +74,66 @@ spec:
6574
# ...
6675
----
6776

68-
The behavior of the Cluster Operator during the renewal period depends on the settings for the `generateCertificateAuthority` certificate generation properties for the cluster CA and clients CA.
77+
Automatic certificate renewal depends on the `generateCertificateAuthority` setting:
6978

70-
`true`:: If the properties are set to `true`, a CA certificate is generated automatically by the Cluster Operator, and renewed automatically within the renewal period.
71-
`false`:: If the properties are set to `false`, a CA certificate is not generated by the Cluster Operator. Use this option if you are xref:installing-your-own-ca-certificates-{context}[installing your own certificates].
79+
* If `true`, the Cluster Operator handles renewal.
80+
* If `false`, certificates must be managed externally. +
81+
Use this option if you are xref:installing-your-own-ca-certificates-{context}[installing your own certificates].
7282

73-
== Renewing automatically generated CA Certificates
83+
== Cluster CA renewal
7484

75-
When it's time to renew CA certificates, the Cluster Operator follows these steps:
85+
To renew the Cluster CA certificate, the Cluster Operator does the following:
7686

77-
. Generates a new CA certificate, but retains the existing key.
87+
. Generates a new Cluster CA certificate, retaining the existing private key.
7888
+
79-
The new certificate replaces the old one with the name `ca.crt` within the corresponding `Secret`.
89+
The renewed certificate replaces `ca.crt` in the Cluster CA secret.
8090

81-
. Generates new client certificates (for Kafka nodes, Entity Operator, Kafka Exporter, and Cruise Control).
91+
. Regenerates internal client certificates for the following components:
92+
** Kafka nodes
93+
** Entity Operator (Topic Operator and User Operator)
94+
** Kafka Exporter
95+
** Cruise Control
8296
+
83-
This is not strictly necessary because the signing key has not changed, but it keeps the validity period of the client certificate in sync with the CA certificate.
97+
These new certificates are not strictly required, because the signing key hasn't changed.
98+
However, the Cluster Operator regenerates them to align their validity period with the new CA certificate.
8499

85-
. Restarts Kafka nodes to trust the new CA certificate and use the new client certificates.
100+
. Restarts the components to trust the new Cluster CA certificate and use the renewed internal certificates.
86101

87-
. Restarts the Topic Operator and User Operator to trust the new CA certificate and use the new client certificates.
102+
=== Clients CA renewal
88103

89-
. Restarts Cruise Control to trust the new CA certificate and use the new client certificates.
90-
91-
. Restarts the Kafka Exporter to trust the new CA certificate and use the new client certificates.
104+
To renew the Clients CA certificate, the Cluster Operator and User Operator each perform part of the process:
92105

106+
. The Cluster Operator generates a new Clients CA certificate, retaining the existing private key.
93107
+
94-
User certificates are signed by the clients CA.
95-
The User Operator handles renewing user certificates when the client's CA is renewed.
108+
The renewed certificate replaces `ca.crt` in the Clients CA secret.
109+
110+
. The User Operator detects the updated Clients CA certificate and regenerates the user certificates that are signed by it.
111+
112+
IMPORTANT: After renewal, you must ensure client applications update their truststores and keystores with the renewed user certificates before the old ones expire to avoid connection failures.
113+
114+
== Managing certificate renewal for client applications
96115

97-
== Renewing client certificates
116+
The Strimzi operators do not manage external client applications.
117+
You are responsible for ensuring that clients continue to connect successfully after certificate renewal.
98118

99-
The Cluster Operator is not aware of the client applications using the Kafka cluster.
100-
You must ensure clients continue to work after certificate renewal.
101-
The renewal process depends on how the clients are configured.
119+
When the Clients CA is renewed, the User Operator automatically regenerates user certificates.
120+
Client applications must be updated to use these renewed credentials before the old certificates expire.
102121

103-
When connecting to the cluster, and to ensure they operate correctly, client applications must include the following configuration:
122+
Client applications must be configured with the following:
104123

105-
* Truststore credentials from the `<cluster_name>-cluster-ca-cert` secret to verify the identity of the Kafka cluster.
106-
* Keystore credentials from the `<user_name>` secret to connect to verify the user when connecting to the Kafka cluster.
124+
* A truststore that includes credentials from the `<cluster_name>-cluster-ca-cert` secret, which is created by the Cluster Operator and contains the public key to verify the Kafka cluster.
125+
* A keystore built from the `<kafka_user_name>` secret, which is created by the User Operator and contains the user's certificate and key.
107126

108-
The user secret provides credentials in PEM and PKCS #12 format, or it can provide a password when using SCRAM-SHA authentication.
109-
The User Operator creates the user credentials when a user is created.
110-
For an example of adding certificates to client configuration, see xref:proc-configuring-secure-kafka-user-str[].
127+
User secrets provide credentials in PEM and PKCS #12 formats, or a password if using SCRAM-SHA authentication.
128+
The User Operator creates these secrets when a user is created.
129+
For an example of configuring secure clients, see xref:proc-configuring-secure-kafka-user-str[].
111130

112-
If you are provisioning client certificates and keys manually, you must generate new client certificates and ensure the new certificates are used by clients within the renewal period.
113-
Failure to do this by the end of the renewal period could result in client applications being unable to connect to the cluster.
131+
If you provision client certificates manually, generate and distribute new certificates before the current ones expire.
132+
Failure to do so can result in clients being unable to connect to the Kafka cluster.
114133

115-
NOTE: For workloads running inside the same Kubernetes cluster and namespace, secrets can be mounted as a volume so the client pods construct their keystores and truststores from the current state of the secrets.
116-
For more details on this procedure, see xref:configuring-internal-clients-to-trust-cluster-ca-{context}[Configuring internal clients to trust the cluster CA].
134+
[NOTE]
135+
====
136+
For workloads in the same Kubernetes cluster and namespace, you can mount secrets as volumes.
137+
This allows client pods to construct keystores and truststores dynamically from the current state of the secrets.
138+
For details, see xref:configuring-internal-clients-to-trust-cluster-ca-{context}[Configuring internal clients to trust the cluster CA].
139+
====

0 commit comments

Comments
 (0)