Skip to content

Commit 60e2e7e

Browse files
committed
Add information about the openshift-service-ca.crt ConfigMap
The openshift kube-controller-manager maintains a ConfigMap in every namespace that publishes the service serving certifcate CA. Adding it to the documentation for users. Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
1 parent 0845404 commit 60e2e7e

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * security/certificates/service-serving-certificate.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="access-default-service-serving-configmap_{context}"]
7+
= Access the service CA bundle in the default config map
8+
9+
A pod can access the service CA certificate by mounting the default
10+
`ConfigMap` object that exists in every namespace (project). The service CA
11+
certificate is in the `service-ca.crt` key of the `openshift-service-ca.crt`
12+
config map. Access to this CA certificate allows TLS clients to verify
13+
connections to services using service serving certificates.
14+
15+
.Procedure
16+
17+
. View the default config map:
18+
+
19+
[source,terminal]
20+
----
21+
$ oc get configmap openshift-service-ca.crt -o yaml
22+
----
23+
+
24+
The CA bundle is displayed as the value of the `service-ca.crt` key in the YAML output:
25+
+
26+
[source,terminal]
27+
----
28+
apiVersion: v1
29+
data:
30+
service-ca.crt: |
31+
-----BEGIN CERTIFICATE-----
32+
...
33+
----
34+
35+
. Mount the config map as a volume to each container that exists in a pod by configuring your `Deployment` object.
36+
+
37+
.Example Deployment object that defines the volume for the mounted config map
38+
[source,yaml]
39+
----
40+
apiVersion: apps/v1
41+
kind: Deployment
42+
metadata:
43+
name: my-example-custom-ca-deployment
44+
namespace: my-example-custom-ca-ns
45+
spec:
46+
...
47+
spec:
48+
...
49+
containers:
50+
- name: my-container-that-needs-custom-ca
51+
volumeMounts:
52+
- name: trusted-ca
53+
mountPath: /etc/pki/ca-trust/extracted/pem
54+
readOnly: true
55+
volumes:
56+
- name: trusted-ca
57+
configMap:
58+
name: openshift-service-ca.crt <1>
59+
items:
60+
- key: ca-bundle.crt <2>
61+
path: tls-ca-bundle.pem <3>
62+
# ...
63+
----
64+
<1> `openshift-service-ca.crt` is the name of the default config map.
65+
<2> `ca-bundle.crt` is required as the ConfigMap key.
66+
<3> `tls-ca-bundle.pem` is required as the ConfigMap path.

security/certificates/service-serving-certificate.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ include::modules/customize-certificates-add-service-serving.adoc[leveloffset=+1]
1717
.Additional resources
1818
* You can use a service certificate to configure a secure route using reencrypt TLS termination. For more information, see xref:../../networking/ingress_load_balancing/routes/creating-advanced-routes.adoc#nw-ingress-creating-a-reencrypt-route-with-a-custom-certificate_secured-routes[Creating a re-encrypt route with a custom certificate].
1919
20+
include::modules/customize-certificates-access-default-service-serving-configmap.adoc[leveloffset=+1]
21+
2022
include::modules/customize-certificates-add-service-serving-configmap.adoc[leveloffset=+1]
2123

2224
include::modules/customize-certificates-add-service-serving-apiservice.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)