-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[GH#87271] Add information about the openshift-service-ca.crt ConfigMap #87272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// 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 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 config map to ensure that the service CA bundle is available: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked the code and the configmap must be there. If it gets deleted it gets recreated. So there is no direct point in checking that it is there. But there is value in showing the configmap, its name and the key / pem encoding. |
||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get configmap openshift-service-ca.crt -o yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably needs a namespace set here? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
---- | ||
+ | ||
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----- | ||
... | ||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"project" and "namespace" are synonyms in OpenShift, but using namespace is more consistent with Kubernetes docs. You might clarify:
“…exists in every namespace (project).”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current step shows how to verify the config map exists, and better to expand this with a second step showing how to actually consume it inside a Pod.
2. Mount the config map into your pod so that applications can use the CA to validate TLS connections. Add a volume and volume mount in your pod specification:
And step 3, include a verification workflow.
3. Test the CA with a TLS connection to a service that is using an OpenShift-issued serving certificate. For example, if you have a service named my-service in the same namespace, you can run the following command inside the pod:
If the connection succeeds without certificate errors, the service CA bundle is working correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing, do we have a html version link to review.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only important thing is that we show them that this configmap exists and that it has a particular key and the value has a PEM header.
How to mount that configmap might be good to reference, but if one would add it there, it might be a little off-topic.