OCPBUGS-122257: Discover OAuth route before generating cert in HCP OAuth procedure - #119713
Patrickdsa00 wants to merge 1 commit into
Conversation
|
@Patrickdsa00: This pull request references Jira Issue OCPBUGS-122257, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Hi @Patrickdsa00. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/jira refresh |
|
@Patrickdsa00: This pull request references Jira Issue OCPBUGS-122257, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/ok-to-test |
|
🤖 Fri Sep 18 19:26:38 - Prow CI generated the docs preview: |
|
@Patrickdsa00: This pull request references Jira Issue OCPBUGS-122257, which is valid. 3 validation(s) were run on this bug
DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
| ==== | ||
|
|
||
| . Confirm that the file exists by entering the following command: | ||
| .. If the route name is `oauth`, confirm it by entering the following command: |
There was a problem hiding this comment.
The HyperShift always creates this route as 'oauth'.
| [source,terminal] | ||
| ---- | ||
| $ ls tls.crt tls.key | ||
| $ oc get route oauth -n ${HC_NAMESPACE}-${CLUSTER_NAME} -o yaml |
There was a problem hiding this comment.
To confirm the route exists and route name is 'oauth', a check like '$ oc get route oauth -n ${HC_NAMESPACE}-${CLUSTER_NAME}' is cleaner
| [source,terminal] | ||
| ---- | ||
| $ oc get routes -n ${HC_NAMESPACE}-${CLUSTER_NAME} | ||
| oauth-<hosted_cluster_namespace>-<hosted_cluster_name>.apps.<management_cluster_name>.<base_domain> |
There was a problem hiding this comment.
Here is the test log when I tested oauth, in my test setup, the hostedcluster name is 'jie-test', base domain is 'jiezhao-hypershift.qe.devcluster.openshift.com', it shows:
$ oc get route -n clusters-jie-test | grep oauth
oauth oauth-jie-test.jiezhao-hypershift.qe.devcluster.openshift.com oauth-openshift passthrough/None None
oauth-internal oauth.apps.jie-test.hypershift.local oauth-openshift passthrough/None None
so correct format should be:
oauth-<hosted_cluster_name>.<hosted_cluster_baseDomain>
There was a problem hiding this comment.
Thanks for testing this! I think both of us are seeing correct but different behavior...
When deploying it I get the oauth-<hosted_cluster_namespace>-<hosted_cluster_name>.apps.<management_cluster_name>.<base_domain> format.
I guess it's because my cluster was deployed without external DNS set at creation (--external-dns-domain) while yours had it set. Below would return empty output here.
$ ./oc get hostedcluster <hc> -n <hc ns> -o jsonpath='{range .spec.services[?(@.service=="OAuthServer")]}{.servicePublishingStrategy.route.hostname}{"\n"}{end}'
Can you check that?
There was a problem hiding this comment.
`oc explain hostedcluster.spec.services.servicePublishingStrategy.route.hostname
GROUP: hypershift.openshift.io
KIND: HostedCluster
VERSION: v1beta1
FIELD: hostname
DESCRIPTION:
hostname is the name of the DNS record that will be created pointing to the
Route and passed through to consumers of the service.
If omitted, the value will be inferred from management ingress.Spec.Domain.`
| $ oc create secret tls my-oauth-cert-secret \ | ||
| --cert=path/to/tls.crt \ | ||
| --key=path/to/tls.key \ | ||
| -n $HC_NAMESPACE |
There was a problem hiding this comment.
path to cert and key should be same as line 86 and 87:
--cert=tls.crt
--key=tls.key \
47272fa to
d599d6b
Compare
…uth procedure Rework the "Configuring OAuth server certificates for a hosted cluster" procedure so it no longer relies on a misleading placeholder hostname: - Remove the api-custom-cert-sample-hosted.sample-hosted.example.com placeholder, which implied the OAuth route lives on the API endpoint domain. The route is served on the management cluster's `apps` wildcard domain, consistent with the HyperShift documentation. - Reorder the steps so the OAuth route is discovered and stored in OAUTH_HOST before the test certificate is generated, so the certificate SAN uses the correct hostname and no certificate regeneration is needed. - Normalize placeholder names to the module's convention (<management_cluster_name>, <base_domain>). - Export OAUTH_HOST, add the missing shell prompt, fix the "kubconfig" typo, and clean up trailing whitespace.
d599d6b to
498dbd3
Compare
|
@Patrickdsa00: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Rework the "Configuring OAuth server certificates for a hosted cluster" procedure so it no longer relies on a misleading placeholder hostname:
appswildcard domain, consistent with the HyperShift documentation.Version(s):
4.20, 4.21, and 4.22
Issue:
https://redhat.atlassian.net/browse/OCPBUGS-122257
Link to docs preview: https://119713--ocpdocs-pr.netlify.app/openshift-enterprise/latest/hosted_control_planes/hcp-certificates.html#hcp-oauth-server-cert_hcp-certificates
QE review: