Skip to content

Commit d0c2488

Browse files
committed
ocpbugs-8882: configure an addditionl clientca for the openshiftapi server
1 parent efd06e5 commit d0c2488

File tree

4 files changed

+64
-7
lines changed

4 files changed

+64
-7
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * security/certificates/api-server.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="configure-an-additional-clientCA-for-the-OpenShift-API-server_{context}"]
7+
8+
= Configure an additional clientCA for the OpenShift API server
9+
10+
Optionally, you may choose to invalidate the installer-generated kubeconfig. You would do this when:
11+
* You don't trust who installed the cluster
12+
* The kubeconfig is leaked
13+
* Other security-related needs exist, such as periodic rotation of the kubeconfig
14+
15+
To replace the installer-generated kubeconfig, remove the installer-generated clientCA from the API server
16+
17+
. Import an additional CA certificate in a configmap of the openshift-config namespace. The CA file must be in PEM format.
18+
+
19+
[source,terminal]
20+
----
21+
oc create configmap client-ca-custom -n openshift-config --from-file=ca-bundle.crt=ca.crt
22+
----
23+
+
24+
. Patch the APIServer instance.
25+
+
26+
[source, terminal]
27+
----
28+
oc patch apiserver cluster --type=merge -p '{"spec": {"clientCA": {"name": "client-ca-custom"}}}'
29+
----
30+
31+
. Test the new clientCA certificate with a certificate signed from the new clientCA.
32+
. If the test is successful, you can remove the installer-generated clientCA.
33+
34+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * security/certificates/api-server.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="configure-an-additional-clientca-for-the-openshift-api-server_{context}"]
7+
= Configure an additional clientCA for the OpenShift API server
8+
9+
. Import the CA certificate in a configmap of the openshift-config namespace. The CA file must be in PEM format.
10+
+
11+
[source,terminal]
12+
----
13+
$ oc create configmap client-ca-custom -n openshift-config --from-file=ca-bundle.crt=ca.crt
14+
----
15+
16+
. Patch the APIServer instance.
17+
+
18+
[source,terminal]
19+
----
20+
$oc patch apiserver cluster --type=merge -p '{"spec": {"clientCA": {"name": "client-ca-custom"}}}'
21+
----
22+
23+
. Import the CA certificate in a configmap of the openshift-config namespace. The CA file must be in PEM format.
24+
25+
After adding the new CA, any API request providing an x.509 client certificate signed by the new CA and matching a valid user is successfully authenticated.
26+

modules/customize-certificates-api-add-named.adoc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ certificate for the API server FQDN must be the first certificate in the file.
2222
It can then be followed with any intermediate certificates, and the file should
2323
end with the root CA certificate.
2424
25-
[WARNING]
26-
====
27-
Do not provide a named certificate for the internal load balancer (host
28-
name `api-int.<cluster_name>.<base_domain>`). Doing so will leave your
29-
cluster in a degraded state.
30-
====
31-
3225
.Procedure
3326

3427
. Login to the new API as the `kubeadmin` user.

security/certificates/api-server.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ API server's certificate by default. This certificate can be replaced
1212
by one that is issued by a CA that clients trust.
1313

1414
include::modules/customize-certificates-api-add-named.adoc[leveloffset=+1]
15+
16+
include::modules/configure-an-additional-clientCA.adoc[leveloffset=+1]
17+
18+

0 commit comments

Comments
 (0)