Skip to content

Commit ac85cd5

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 5859f98 commit ac85cd5

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

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

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
* 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)