-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[OSDOCS-14647]: Config custom API server cert for a hosted cluster #97081
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
Merged
lahinson
merged 1 commit into
openshift:main
from
lahinson:osdocs-14647-hcp-custom-certificates
Aug 13, 2025
+92
−8
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * hosted-control-planes/hcp-deploy/hcp-deploy-aws.adoc | ||
| // * hosted-control-planes/hcp-deploy/hcp-deploy-bm.adoc | ||
| // * hosted-control-planes/hcp-deploy/hcp-deploy-non-bm.adoc | ||
| // * hosted-control-planes/hcp-deploy/hcp-deploy-virt.adoc | ||
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="hcp-custom-cert_{context}"] | ||
| = Configuring a custom API server certificate in a hosted cluster | ||
|
|
||
| To configure a custom certificate for the API server, specify the certificate details in the `spec.configuration.apiServer` section of your `HostedCluster` configuration. | ||
|
|
||
| You can configure a custom certificate during either day-1 or day-2 operations. However, because the service publishing strategy is immutable after you set it during hosted cluster creation, you must know what the hostname is for the Kubernetes API server that you plan to configure. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * You created a Kubernetes secret that contains your custom certificate in the management cluster. The secret contains the following keys: | ||
|
|
||
| ** `tls.crt`: The certificate | ||
| ** `tls.key`: The private key | ||
|
|
||
| * If your `HostedCluster` configuration includes a service publishing strategy that uses a load balancer, ensure that the Subject Alternative Names (SANs) of the certificate do not conflict with the internal API endpoint (`api-int`). The internal API endpoint is automatically created and managed by your platform. If you use the same hostname in both the custom certificate and the internal API endpoint, routing conflictcs can occur. The only exception to this rule is when you use {aws-short} as the provider with either `Private` or `PublicAndPrivate` configurations. In those cases, the SAN conflict is managed by the platform. | ||
|
|
||
| * The certificate must be valid for the external API endpoint. | ||
|
|
||
| * The validity period of the certificate aligns with your cluster's expected life cycle. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Create a secret with your custom certificate by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc create secret tls sample-hosted-kas-custom-cert \ | ||
| --cert=path/to/cert.crt \ | ||
| --key=path/to/key.key \ | ||
| -n <hosted_cluster_namespace> | ||
| ---- | ||
|
|
||
| . Update your `HostedCluster` configuration with the custom certificate details, as shown in the following example: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| spec: | ||
| configuration: | ||
| apiServer: | ||
| servingCerts: | ||
| namedCertificates: | ||
| - names: <1> | ||
| - api-custom-cert-sample-hosted.sample-hosted.example.com | ||
| servingCertificate: <2> | ||
| name: sample-hosted-kas-custom-cert | ||
| ---- | ||
| <1> The list of DNS names that the certificate is valid for. | ||
| <2> The name of the secret that contains the custom certificate. | ||
|
|
||
| . Apply the changes to your `HostedCluster` configuration by entering the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc apply -f <hosted_cluster_config>.yaml | ||
| ---- | ||
|
|
||
| .Verification | ||
|
|
||
| * Check the API server pods to ensure that the new certificate is mounted. | ||
|
|
||
| * Test the conncetion to the API server by using the custom domain name. | ||
|
|
||
| * Verify the certificate details in your browser or by using tools such as `openssl`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Out of scope (existing content) but at some point step 1 should probably be split into four substeps with a short explanation of what each command is doing.
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.
Agree. I'll make a note of that.