Skip to content

Conversation

Jamstah
Copy link

@Jamstah Jamstah commented Jan 20, 2025

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.

Version(s):
This functionality has existed since OpenShift 4.12.

Issue:
#87271

Link to docs preview:
https://87272--ocpdocs-pr.netlify.app/openshift-enterprise/latest/security/certificates/service-serving-certificate.html

QE review:

  • QE has approved this change.

Additional information:

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 <[email protected]>
@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 20, 2025
Copy link

openshift-ci bot commented Jan 20, 2025

Hi @Jamstah. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Jamstah
Copy link
Author

Jamstah commented Jan 20, 2025

Hi @openshift/team-documentation, can I please have an OK to test on this one.

@bergerhoffer
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 20, 2025
@bergerhoffer
Copy link
Contributor

/retest

@bergerhoffer
Copy link
Contributor

@Jamstah thanks for submitting this! Something funky is going on with our tests, but I'll help move this along (need to get engineering/QE review as well).

I'll probably have some nits about the files - are you okay with making the updates if I point them out (and then squashing the commits afterward), or would you prefer me to take over the PR to make those final updates?

@bergerhoffer
Copy link
Contributor

/retest

@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Jan 20, 2025

@bergerhoffer
Copy link
Contributor

@tkashem @wangke19 Can you confirm whether this is accurate and okay to document?

@Jamstah
Copy link
Author

Jamstah commented Jan 21, 2025

I'll probably have some nits about the files - are you okay with making the updates if I point them out (and then squashing the commits afterward), or would you prefer me to take over the PR to make those final updates?

However you like to work :)

@bergerhoffer
Copy link
Contributor

The branch/enterprise-4.19 label has been added to this PR.

This is because your PR targets the main branch and is labeled for enterprise-4.18. And any PR going into main must also target the latest version branch (enterprise-4.19).

If the update in your PR does NOT apply to version 4.19 onward, please re-target this PR to go directly into the appropriate version branch or branches (enterprise-4.x) instead of main.

@Jamstah
Copy link
Author

Jamstah commented Feb 25, 2025

@tkashem @wangke19 please review :)

@Jamstah
Copy link
Author

Jamstah commented Mar 18, 2025

@bergerhoffer is there anyone else who can approve?

@bergerhoffer
Copy link
Contributor

Sorry for the delay, I've pinged again, we'll try to get someone soon.

@bergerhoffer
Copy link
Contributor

The branch/enterprise-4.20 label has been added to this PR.

This is because your PR targets the main branch and is labeled for enterprise-4.19. And any PR going into main must also target the latest version branch (enterprise-4.20).

If the update in your PR does NOT apply to version 4.20 onward, please re-target this PR to go directly into the appropriate version branch or branches (enterprise-4.x) instead of main.

@Jamstah
Copy link
Author

Jamstah commented Aug 20, 2025

@tkashem @wangke19 @bergerhoffer Can I get a review on this? We'd really like to be able to rely on this behaviour but its hard to do that when its undocumented.

= 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

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).”

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:

apiVersion: v1
kind: Pod
metadata:
  name: service-ca-example
spec:
  containers:
  - name: app
    image: registry.redhat.io/ubi9/ubi-minimal
    command: ["/bin/sh", "-c", "sleep 3600"]
    volumeMounts:
    - name: service-ca
      mountPath: /var/run/configmaps/service-ca
      readOnly: true
  volumes:
  - name: service-ca
    configMap:
      name: openshift-service-ca.crt

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:

curl --cacert /var/run/configmaps/service-ca/service-ca.crt https://my-service:443

If the connection succeeds without certificate errors, the service CA bundle is working correctly.

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.

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.

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.

@wangke19
Copy link

@Jamstah @bergerhoffer Abu(tkashem) has been moved to Node team, next time ask @vrutkovs to review certificates related Docs.

+
[source,terminal]
----
$ oc get configmap openshift-service-ca.crt -o yaml
Copy link
Member

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.

@bergerhoffer
Copy link
Contributor

/retest

@bergerhoffer
Copy link
Contributor

Closing/reopening to try to kick off the tests again, since the preview link has since expired

Copy link

openshift-ci bot commented Aug 25, 2025

@Jamstah: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.


.Procedure

. View the config map to ensure that the service CA bundle is available:
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants