|
| 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 | +---- |
0 commit comments