Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] AsciiDocDITA.ShortDescription: Assign [role="_abstract"] to a paragraph to use it as in DITA.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Module included in the following assemblies:
//
// * security/certificates/service-serving-certificate.adoc

:_mod-docs-content-type: PROCEDURE
[id="access-default-service-serving-configmap_{context}"]
= Access the service CA bundle in the default config map

A pod can access the service CA certificate by mounting the default
`ConfigMap` object that exists in every namespace (project). The service CA
certificate is in the `service-ca.crt` key of the `openshift-service-ca.crt`
config map. Access to this CA certificate allows TLS clients to verify
connections to services using service serving certificates.

.Procedure

. View the default config map:
+
[source,terminal]
----
$ oc get configmap openshift-service-ca.crt -o yaml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs a namespace set here?

Copy link
Contributor

@ibihim ibihim Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the context of mounting that configmap it would be necessary to use a specific namespace.

If you don't specify any, it returns the one on the default namespace / current project, so it works, but we can't be sure, that this is from the current project.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the configmap is in every namespace, I didn't include the namespace argument here.

----
+
The CA bundle is displayed as the value of the `service-ca.crt` key in the YAML output:
+
[source,terminal]
----
apiVersion: v1
data:
service-ca.crt: |
-----BEGIN CERTIFICATE-----
...
----

. Mount the config map as a volume to each container that exists in a pod by configuring your `Deployment` object.
+
.Example Deployment object that defines the volume for the mounted config map
[source,yaml]
----
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-example-custom-ca-deployment
namespace: my-example-custom-ca-ns
spec:
...
spec:
...
containers:
- name: my-container-that-needs-custom-ca
volumeMounts:
- name: trusted-ca
mountPath: /etc/pki/ca-trust/extracted/pem
readOnly: true
volumes:
- name: trusted-ca
configMap:
name: openshift-service-ca.crt <1>
items:
- key: ca-bundle.crt <2>
path: tls-ca-bundle.pem <3>
# ...
----
<1> `openshift-service-ca.crt` is the name of the default config map.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] AsciiDocDITA.CalloutList: Callouts are not supported in DITA.

<2> `ca-bundle.crt` is required as the ConfigMap key.
<3> `tls-ca-bundle.pem` is required as the ConfigMap path.
2 changes: 2 additions & 0 deletions security/certificates/service-serving-certificate.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ include::modules/customize-certificates-add-service-serving.adoc[leveloffset=+1]
.Additional resources
* 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].

include::modules/customize-certificates-access-default-service-serving-configmap.adoc[leveloffset=+1]

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

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