Skip to content

Commit 9e8c2d0

Browse files
authored
Merge pull request #34947 from bergerhoffer/pr-34077
Custom certs for the oAuth server route
2 parents 45283d2 + 1bc8bfa commit 9e8c2d0

File tree

3 files changed

+72
-10
lines changed

3 files changed

+72
-10
lines changed

authentication/configuring-internal-oauth.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ include::modules/oauth-configuring-internal-oauth.adoc[leveloffset=+1]
1515

1616
include::modules/oauth-configuring-token-inactivity-timeout.adoc[leveloffset=+1]
1717

18+
include::modules/oauth-customizing-the-oauth-server-URL.adoc[leveloffset=+1]
19+
1820
include::modules/oauth-server-metadata.adoc[leveloffset=+1]
1921

2022
include::modules/oauth-troubleshooting-api-events.adoc[leveloffset=+1]

modules/customizing-the-web-console-URL.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ For `console` and `downloads` routes, custom routes functionality uses the `ingr
1010
[id="customizing-the-console-route_{context}"]
1111
== Customizing the console route
1212

13-
You can customize the console route by setting the custom host name and TLS certificate in the `spec.componentRoutes` field of the cluster `Ingress` configuration.
13+
You can customize the console route by setting the custom hostname and TLS certificate in the `spec.componentRoutes` field of the cluster `Ingress` configuration.
1414

1515
.Prerequisites
1616

1717
* You have logged in to the cluster as a user with administrative privileges.
18-
* You have created a secret in the `openshift-config` namespace containing the TLS certificate and key. This is required if the domain for the custom host name suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
18+
* You have created a secret in the `openshift-config` namespace containing the TLS certificate and key. This is required if the domain for the custom hostname suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
1919
+
2020
[TIP]
2121
====
@@ -31,7 +31,7 @@ You can create a TLS secret by using the `oc create secret tls` command.
3131
$ oc edit ingress.config.openshift.io cluster
3232
----
3333

34-
. Set the custom host name and optionally the serving certificate and key:
34+
. Set the custom hostname and optionally the serving certificate and key:
3535
+
3636
[source,yaml]
3737
----
@@ -47,20 +47,20 @@ spec:
4747
servingCertKeyPairSecret:
4848
name: <secret_name> <2>
4949
----
50-
<1> The custom host name.
51-
<2> Reference to a secret in the `openshift-config` namespace that contains a TLS certificate (`tls.crt`) and key (`tls.key`). This is required if the domain for the custom host name suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
50+
<1> The custom hostname.
51+
<2> Reference to a secret in the `openshift-config` namespace that contains a TLS certificate (`tls.crt`) and key (`tls.key`). This is required if the domain for the custom hostname suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
5252

5353
. Save the file to apply the changes.
5454

5555
[id="customizing-the-download-route_{context}"]
5656
== Customizing the download route
5757

58-
You can customize the download route by setting the custom host name and TLS certificate in the `spec.componentRoutes` field of the cluster `Ingress` configuration.
58+
You can customize the download route by setting the custom hostname and TLS certificate in the `spec.componentRoutes` field of the cluster `Ingress` configuration.
5959

6060
.Prerequisites
6161

6262
* You have logged in to the cluster as a user with administrative privileges.
63-
* You have created a secret in the `openshift-config` namespace containing the TLS certificate and key. This is required if the domain for the custom host name suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
63+
* You have created a secret in the `openshift-config` namespace containing the TLS certificate and key. This is required if the domain for the custom hostname suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
6464
+
6565
[TIP]
6666
====
@@ -76,7 +76,7 @@ You can create a TLS secret by using the `oc create secret tls` command.
7676
$ oc edit ingress.config.openshift.io cluster
7777
----
7878

79-
. Set the custom host name and optionally the serving certificate and key:
79+
. Set the custom hostname and optionally the serving certificate and key:
8080
+
8181
[source,yaml]
8282
----
@@ -92,7 +92,7 @@ spec:
9292
servingCertKeyPairSecret:
9393
name: <secret_name> <2>
9494
----
95-
<1> The custom host name.
96-
<2> Reference to a secret in the `openshift-config` namespace that contains a TLS certificate (`tls.crt`) and key (`tls.key`). This is required if the domain for the custom host name suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
95+
<1> The custom hostname.
96+
<2> Reference to a secret in the `openshift-config` namespace that contains a TLS certificate (`tls.crt`) and key (`tls.key`). This is required if the domain for the custom hostname suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
9797

9898
. Save the file to apply the changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * authentication/configuring-internal-oauth.adoc
4+
5+
[id="customizing-the-oauth-server-url_{context}"]
6+
= Customizing the internal OAuth server URL
7+
8+
You can customize the internal OAuth server URL by setting the custom hostname and TLS certificate in the `spec.componentRoutes` field of the cluster `Ingress` configuration.
9+
10+
[WARNING]
11+
====
12+
If you update the internal OAuth server URL, you might break trust from components in the cluster that need to communicate with the OpenShift OAuth server to retrieve OAuth access tokens. Components that need to trust the OAuth server will need to include the proper CA bundle when calling OAuth endpoints. For example:
13+
14+
[source,terminal]
15+
----
16+
$ oc login -u <username> -p <password> --certificate-authority=<path_to_ca.crt>
17+
----
18+
19+
The Cluster Authentication Operator publishes the OAuth server's serving certificate in the `oauth-serving-cert` config map in the `openshift-config-managed` namespace. You can find the certificate in the `data.ca-bundle.crt` key of the config map.
20+
====
21+
22+
.Prerequisites
23+
24+
* You have logged in to the cluster as a user with administrative privileges.
25+
* You have created a secret in the `openshift-config` namespace containing the TLS certificate and key. This is required if the domain for the custom hostname suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
26+
+
27+
[TIP]
28+
====
29+
You can create a TLS secret by using the `oc create secret tls` command.
30+
====
31+
32+
.Procedure
33+
34+
. Edit the cluster `Ingress` configuration:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc edit ingress.config.openshift.io cluster
39+
----
40+
41+
. Set the custom hostname and optionally the serving certificate and key:
42+
+
43+
[source,yaml]
44+
----
45+
apiVersion: config.openshift.io/v1
46+
kind: Ingress
47+
metadata:
48+
name: cluster
49+
spec:
50+
componentRoutes:
51+
- name: oauth-openshift
52+
namespace: openshift-authentication
53+
hostname: <custom_hostname> <1>
54+
servingCertKeyPairSecret:
55+
name: <secret_name> <2>
56+
----
57+
<1> The custom hostname.
58+
<2> Reference to a secret in the `openshift-config` namespace that contains a TLS certificate (`tls.crt`) and key (`tls.key`). This is required if the domain for the custom hostname suffix does not match the cluster domain suffix. The secret is optional if the suffix matches.
59+
60+
. Save the file to apply the changes.

0 commit comments

Comments
 (0)