Skip to content

Commit 90af83a

Browse files
authored
Merge pull request #81659 from tmalove/etcd-auto-rotate-cert-11238-tlove
OSDOCS#11238: Auto-rotation of etcd signer certs
2 parents 027b99a + b6c41dd commit 90af83a

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

modules/etcd-cert-alerts-metrics-signer.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
[id="etcd-cert-alerts-metrics-signer_{context}"]
77
= etcd certificate rotation alerts and metrics signer certificates
88

9-
Two alert types inform users about pending `etcd` certificate expiration:
9+
Two alerts inform users about pending `etcd` certificate expiration:
1010

1111
`etcdSignerCAExpirationWarning`:: Occurs 730 days until the signer expires.
1212
`etcdSignerCAExpirationCritical`:: Occurs 365 days until the signer expires.
1313

14+
These alerts track the expiration date of the signer certificate authorities in the `openshift-etcd` namespace.
15+
1416
You can rotate the certificate for the following reasons:
1517

1618
* You receive an expiration alert.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Module included in the following assemblies:
2+
//
3+
// security/certificate_types_descriptions/etcd-certificates.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="removing-unused-ca-bundle_{context}"]
7+
= Removing an unused certificate authority from the bundle
8+
9+
A manual rotation does not immediately update the trust bundle to remove the public key of a previous signer certificate.
10+
11+
The public key of the signer certificate is removed at the expiration date, however if the public key must be removed before it expires, you can delete it.
12+
13+
.Procedure
14+
15+
. Delete the key by running the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc delete configmap -n openshift-etcd etcd-ca-bundle
20+
----
21+
22+
. Wait for the static pod rollout by running the following command. The bundle regenerates with the current signer certificate and all unknown or unused keys are deleted.
23+
+
24+
[source,terminal]
25+
----
26+
$ oc adm wait-for-stable-cluster --minimum-stable-period 2m
27+
----
28+

modules/rotating-certificate-authority.adoc

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,28 @@
66
[id="rotating-certificate-authority_{context}"]
77
= Rotating the etcd certificate
88

9-
Rotate the `etcd` certificate before it expires.
9+
The `etcd` certificate automatically rotates using the etcd cluster Operator. However, if a certificate must be rotated before it is automatically rotated, you can manually rotate it.
1010

1111
.Procedure
1212

13-
. Verify the remaining lifetime of the new signer certificate by running the following command:
13+
. Make a backup copy of the current signer certificate by running the following command:
1414
+
1515
[source,terminal]
1616
----
17-
$ oc get secret -n openshift-etcd etcd-signer -ojsonpath='{.metadata.annotations.auth\.openshift\.io/certificate-not-after}'
17+
$ oc get secret -n openshift-etcd etcd-signer -oyaml > signer_backup_secret.yaml
1818
----
1919

20-
. If the remaining lifetime is close to the current date, re-create the signer by deleting the signer and wait for the static pod roll out.
21-
* Delete the signer by running the following command:
20+
. Delete the existing signer certificate by running the following command:
2221
+
2322
[source,terminal]
2423
----
2524
$ oc delete secret -n openshift-etcd etcd-signer
2625
----
2726

28-
* Wait for the static pod roll out by running the following command:
27+
. Wait for the static pod roll out by running the following command. The static pod roll out can take a few minutes to complete.
2928
+
3029
[source,terminal]
3130
----
3231
$ oc wait --for=condition=Progressing=False --timeout=15m clusteroperator/etcd
3332
----
3433

35-
. After `etcd` restarts, switch the original CA in the `openshift-config` namespace with the new, rotated one in `openshift-etcd` by running the following command:
36-
+
37-
[source,terminal]
38-
----
39-
$ oc get secret etcd-signer -n openshift-etcd -ojson | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid"])' | oc apply -n openshift-config -f -
40-
----
41-
42-
. Wait for the cluster Operators to roll out and stabilize by running the following command:
43-
+
44-
[source,terminal]
45-
----
46-
$ oc adm wait-for-stable-cluster --minimum-stable-period 2m
47-
----

security/certificate_types_descriptions/etcd-certificates.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ etcd certificates are signed by the etcd-signer; they come from a certificate au
1515
The CA certificates are valid for 10 years. The peer, client, and server certificates are valid for three years.
1616

1717
include::modules/rotating-certificate-authority.adoc[leveloffset=+1]
18+
include::modules/removing-unused-ca-bundle.adoc[leveloffset=+1]
1819
include::modules/etcd-cert-alerts-metrics-signer.adoc[leveloffset=+1]
1920

2021
== Management

0 commit comments

Comments
 (0)