Skip to content

Commit 154a868

Browse files
committed
OSDOCS-6677: add new mco/mcc cert procedure
1 parent f39867b commit 154a868

File tree

3 files changed

+85
-11
lines changed

3 files changed

+85
-11
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * post_installation_configuration/machine-configuration-tasks.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="checking-mco-status-certs_{context}"]
7+
= Viewing and interacting with certificates
8+
9+
The following certificates are handled in the cluster by the Machine Config Controller (MCC) and can be found in the `ControllerConfig` resource:
10+
11+
* `/etc/kubernetes/kubelet-ca.crt`
12+
* `/etc/kubernetes/static-pod-resources/configmaps/cloud-config/ca-bundle.pem`
13+
* `/etc/pki/ca-trust/source/anchors/openshift-config-user-ca-bundle.crt`
14+
15+
The MCC also handles the image registry certificates and its associated user bundle certificate.
16+
17+
You can get information about the listed certificates, including the underyling bundle the certificate comes from, and the signing and subject data.
18+
19+
.Procedure
20+
21+
* Get detailed certificate information by running the following command:
22+
+
23+
[source,terminal]
24+
----
25+
$ oc get controllerconfig/machine-config-controller -o yaml | yq -y '.status.controllerCertificates'
26+
----
27+
+
28+
.Example output
29+
+
30+
[source,text]
31+
----
32+
"controllerCertificates": [
33+
{
34+
"bundleFile": "KubeAPIServerServingCAData",
35+
"signer": "<signer_data1>",
36+
"subject": "CN=openshift-kube-apiserver-operator_node-system-admin-signer@168909215"
37+
},
38+
{
39+
"bundleFile": "RootCAData",
40+
"signer": "<signer_data2>",
41+
"subject": "CN=root-ca,OU=openshift"
42+
}
43+
]
44+
----
45+
46+
* Get a simpler version of the information found in the ControllerConfig by checking the machine config pool status using the following command:
47+
+
48+
[source,terminal]
49+
----
50+
$ oc get mcp master -o yaml | yq -y '.status.certExpirys'
51+
----
52+
+
53+
.Example output
54+
+
55+
[source,text]
56+
----
57+
status:
58+
certExpirys:
59+
- bundle: KubeAPIServerServingCAData
60+
subject: CN=admin-kubeconfig-signer,OU=openshift
61+
- bundle: KubeAPIServerServingCAData
62+
subject: CN=kube-csr-signer_@1689585558
63+
- bundle: KubeAPIServerServingCAData
64+
subject: CN=kubelet-signer,OU=openshift
65+
- bundle: KubeAPIServerServingCAData
66+
subject: CN=kube-apiserver-to-kubelet-signer,OU=openshift
67+
- bundle: KubeAPIServerServingCAData
68+
subject: CN=kube-control-plane-signer,OU=openshift
69+
----
70+
+
71+
This method is meant for {product-title} applications that already consume machine config pool information.
72+
73+
* Check which image registry certificates are on the nodes by looking at the contents of the `/etc/docker/cert.d` directory:
74+
+
75+
[source,terminal]
76+
----
77+
# ls /etc/docker/certs.d
78+
----
79+
+
80+
.Example output
81+
[source,text]
82+
----
83+
image-registry.openshift-image-registry.svc.cluster.local:5000 image-registry.openshift-image-registry.svc:5000
84+
----

modules/troubleshooting-disabling-autoreboot-mco.adoc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,3 @@ include::snippets/node-icsp-no-drain.adoc[]
1313
====
1414

1515
To avoid unwanted disruptions, you can modify the machine config pool (MCP) to prevent automatic rebooting after the Operator makes changes to the machine config.
16-
17-
[NOTE]
18-
====
19-
Pausing an MCP prevents the MCO from applying any configuration changes on the associated nodes. Pausing an MCP also prevents any automatically rotated certificates from being pushed to the associated nodes, including the automatic rotation of the `kube-apiserver-to-kubelet-signer` CA certificate.
20-
21-
If the MCP is paused when the `kube-apiserver-to-kubelet-signer` CA certificate expires, and the MCO attempts to renew the certificate automatically, the MCO cannot push the newly rotated certificates to those nodes. This causes the cluster to become degraded and causes failure in multiple `oc` commands, including `oc debug`, `oc logs`, `oc exec`, and `oc attach`. You receive alerts in the Alerting UI of the {product-title} web console if an MCP is paused when the certificates are rotated.
22-
23-
Pausing an MCP should be done with careful consideration about the `kube-apiserver-to-kubelet-signer` CA certificate expiration and for short periods of time only.
24-
25-
New CA certificates are generated at 292 days from the installation date and removed at 365 days from that date. To determine the next automatic CA certificate rotation, see the link:https://access.redhat.com/articles/5651701[Understand CA cert auto renewal in Red Hat OpenShift 4].
26-
====

post_installation_configuration/machine-configuration-tasks.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ include::modules/machine-config-operator.adoc[leveloffset=+2]
1919
include::modules/machine-config-overview.adoc[leveloffset=+2]
2020
include::modules/machine-config-drift-detection.adoc[leveloffset=+2]
2121
include::modules/checking-mco-status.adoc[leveloffset=+2]
22+
include::modules/checking-mco-status-certs.adoc[leveloffset=+2]
2223

2324
[id="using-machineconfigs-to-change-machines"]
2425
== Using MachineConfig objects to configure nodes

0 commit comments

Comments
 (0)