|
3 | 3 | // * web_console/customizing-the-web-console.adoc
|
4 | 4 |
|
5 | 5 | [id="customizing-the-web-console-url_{context}"]
|
6 |
| -= Customizing the web console URL |
| 6 | += Customizing console routes |
7 | 7 |
|
8 |
| -You can update the web console URL, `consoleURL`, to a custom value. |
| 8 | +For `console` and `downloads` routes, custom routes functionality uses the `ingress` config route configuration API. If the `console` custom route is set up in both the `ingress` config and `console-operator` config, then the new `ingress` config custom route configuration takes precedent. The route configuration with the `console-operator` config is deprecated. |
| 9 | + |
| 10 | +[id="customizing-the-console-route_{context}"] |
| 11 | +== Customizing the console route |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* Log in to the cluster as a user with administrative privileges. |
9 | 16 |
|
10 | 17 | .Procedure
|
11 | 18 |
|
12 |
| -. Modify the cluster instance created by default during installation in the `consoles.operator.openshift.io` custom resource: |
13 |
| -+ |
14 |
| -[source,terminal] |
15 |
| ----- |
16 |
| -$ oc patch consoles.operator.openshift.io cluster --patch '{"spec":{"route":{"hostname":"console.example.com"}}}' --type=merge |
17 |
| ----- |
| 19 | +* Set the custom hostname and, if needed, set TLS on the ingress config's spec: |
18 | 20 | +
|
19 | 21 | [source,yaml]
|
20 | 22 | ----
|
21 |
| -apiVersion: operator.openshift.io/v1 |
22 |
| -kind: Console |
| 23 | +apiVersion: config.openshift.io/v1 |
| 24 | +kind: Ingress |
23 | 25 | metadata:
|
24 | 26 | name: cluster
|
25 | 27 | spec:
|
26 |
| - route: |
27 |
| - hostname: 'console.example.com' |
| 28 | + componentRoutes: |
| 29 | + - name: console |
| 30 | + namespace: openshift-console |
| 31 | + hostname: <custom-hostname> |
| 32 | + secret: |
| 33 | + name: <secret-name> |
28 | 34 | ----
|
29 |
| -. If you specify a custom certificate, you must create a secret in the `openshift-config` namespace that has the key and certificate. For example: |
30 | 35 | +
|
31 |
| -[source,terminal] |
32 |
| ----- |
33 |
| -$ oc create secret tls console-tls --key=key.pem --cert=cert.pem -n openshift-config |
34 |
| ----- |
| 36 | +If the domain for the custom hostname suffix does not match the cluster domain suffix, then a secret that contains a TLS certificate and key must exist in the `openshift-config` namespace and must be referenced in the `ingress` config. If the domain for the custom hostname suffix matches the cluster domain suffix, then the secret is optional. The secret must contain `tls.crt` and `tls.key` data keys, where the certificate and key are stored, and both must be in a valid format. |
| 37 | + |
| 38 | +[id="customizing-the-download-route_{context}"] |
| 39 | +== Customizing the download route |
| 40 | + |
| 41 | +.Prerequisites |
| 42 | + |
| 43 | +* Log in to the cluster as a user with administrative privileges. |
| 44 | + |
| 45 | +.Procedure |
| 46 | + |
| 47 | +* Set the custom hostname and, if needed, set TLS on the ingress config's spec: |
35 | 48 | +
|
36 | 49 | [source,yaml]
|
37 | 50 | ----
|
38 |
| -apiVersion: v1 |
39 |
| -kind: Secret |
| 51 | +apiVersion: config.openshift.io/v1 |
| 52 | +kind: Ingress |
40 | 53 | metadata:
|
41 |
| - name: console-tls |
42 |
| - namespace: openshift-config |
43 |
| -type: kubernetes.io/tls |
44 |
| -data: |
45 |
| - tls.crt: >- |
46 |
| - <base64-encoded_cert> ... <1> |
47 |
| - tls.key: >- |
48 |
| - <base64-encoded_key> ... <2> |
49 |
| ----- |
50 |
| -<1> Provide a valid TLS certificate. |
51 |
| -<2> Provide a valid TLS key. |
52 |
| -+ |
53 |
| -Then, edit the web console’s Operator configuration: |
54 |
| -+ |
55 |
| -[source,terminal] |
56 |
| ----- |
57 |
| -$ oc edit consoles.operator.openshift.io cluster |
58 |
| ----- |
59 |
| -+ |
60 |
| -Add the following stanza to the configuration resource: |
61 |
| -+ |
62 |
| -[source,yaml] |
63 |
| ----- |
| 54 | + name: cluster |
64 | 55 | spec:
|
65 |
| - route: |
66 |
| - hostname: console.example.com |
67 |
| - secret: |
68 |
| - name: console-tls |
| 56 | + componentRoutes: |
| 57 | + - name: downloads |
| 58 | + namespace: openshift-console |
| 59 | + hostname: <custom-hostname> |
| 60 | + secret: |
| 61 | + name: <secret-name> |
69 | 62 | ----
|
0 commit comments