Chapter 5. Customizing the web console in Red Hat OpenShift Service on AWS
You can customize the Red Hat OpenShift Service on AWS web console to set a custom logo, product name, and custom component routes. This is especially helpful if you need to tailor the web console to meet specific corporate or government requirements.
5.1. Add a custom logo and product name Copy linkLink copied to clipboard!
You can create custom branding by adding a custom logo or custom product name. You can set both or one without the other, as these settings are independent of each other.
Prerequisites
- You must have administrator privileges.
-
Create a file of the logo that you want to use. The logo can be a file in any common image format, including GIF, JPG, PNG, or SVG, and is constrained to a
max-heightof60px. Image size must not exceed 1 MB due to constraints on theConfigMapobject size.
Procedure
Import your logo file into a config map in the
openshift-confignamespace:$ oc create configmap console-custom-logo --from-file /path/to/console-custom-logo.png -n openshift-configTipYou can alternatively apply the following YAML to create the config map:
apiVersion: v1 kind: ConfigMap metadata: name: console-custom-logo namespace: openshift-config binaryData: console-custom-logo.png: <base64-encoded_logo> ...Replace
<base64-encoded_logo>with a base64-encoded string of the logo.Edit the web console’s Operator configuration to include
customLogoFileandcustomProductName:$ oc edit consoles.operator.openshift.io clusterapiVersion: operator.openshift.io/v1 kind: Console metadata: name: cluster spec: customization: customLogoFile: key: console-custom-logo.png name: console-custom-logo customProductName: My ConsoleOnce the Operator configuration is updated, it will sync the custom logo config map into the console namespace, mount it to the console pod, and redeploy.
Check for success. If there are any issues, the console cluster Operator will report a
Degradedstatus, and the console Operator configuration will also report aCustomLogoDegradedstatus, but with reasons such asKeyOrFilenameInvalidorNoImageProvided.To check the
clusteroperator, run:$ oc get clusteroperator console -o yamlTo check the console Operator configuration, run:
$ oc get consoles.operator.openshift.io -o yaml
5.2. About custom component routes on Red Hat OpenShift Service on AWS Copy linkLink copied to clipboard!
By default, Red Hat OpenShift Service on AWS clusters use service-generated default subdomains for core cluster routes. You can customize these component routes to use personalized, company-owned fully qualified domain names (FQDNs) to satisfy corporate branding and enterprise security requirements.
You can configure custom component routes for the following components on Red Hat OpenShift Service on AWS:
- OpenShift web console
- Downloads page (Command-line interface (CLI) tools)
Customizing the internal OAuth server route or the API server (kube-apiserver) endpoint is not supported on Red Hat OpenShift Service on AWS.
Custom component routes have the following architecture and requirements:
- TLS certificates
-
You must provide your own valid TLS certificate chain and private key stored as a Kubernetes secret in the
openshift-confignamespace on the cluster data plane. - DNS management
- You are responsible for creating and maintaining the necessary CNAME or A records with your DNS provider to route traffic from your custom FQDN to the cluster’s ingress router.
- Automated renewal
- Automated certificate management, such as AWS Certificate Manager or automatic Let’s Encrypt rotation, is not natively integrated at the cluster service level. You must manage certificate renewals manually or by using data-plane Operators such as cert-manager.
5.3. Configure custom component routes for Red Hat OpenShift Service on AWS Copy linkLink copied to clipboard!
You can configure custom component routes for the web console and downloads page on your Red Hat OpenShift Service on AWS cluster. To configure custom routes, you create a TLS secret, configure DNS records, and update the ingress configuration by using the rosa CLI.
Prerequisites
-
You have installed the ROSA command-line interface (CLI) (
rosa). - You have administrator access to a Red Hat OpenShift Service on AWS cluster.
-
You have a custom domain or fully qualified domain name (FQDN) registered, for example,
my-custom-hostname.dev. -
You have a valid TLS certificate (
tls.crt) and private key (tls.key) for the custom domain.
Procedure
Create a TLS secret in the
openshift-confignamespace that has your custom domain’s certificate and private key by running the following command:$ oc create secret tls <secret_name> --cert=<path_to_tls_cert> --key=<path_to_tls_key> -n openshift-configwhere:
<secret_name>-
Specifies a name for the TLS secret, for example,
custom-console-tls. <path_to_tls_cert>- Specifies the path to your TLS certificate file.
<path_to_tls_key>- Specifies the path to your TLS private key file.
In your DNS provider’s management console, add a
CNAMEor anArecord pointing your custom domain to your cluster’s router canonical domain name. The router canonical domain name is the load balancer hostname value for your cluster.For example, in your AWS Route 53 Dashboard, add a CNAME record where
-
Name:
my-custom-hostname.dev(your custom hostname) Value:
a234gsr3242rsfsfs-1342r624.us-east-1.elb.amazonaws.com(your cluster’s load balancer hostname)ImportantIf you do not configure proper DNS records, you cannot access the custom routes.
-
Name:
Update the component routes by using the
rosaCLI:To set a custom domain for the web console, run the following command:
$ rosa edit ingress -c <cluster_name> <ingress_id> --component-routes 'console: hostname=<custom_hostname>;tlsSecretRef=<secret_name>'where:
<custom_hostname>-
Specifies the custom hostname for the web console, for example,
my-custom-hostname.dev. <secret_name>- Specifies the name of the TLS secret you created earlier.
To set a custom domain for the downloads page, run the following command:
$ rosa edit ingress -c <cluster_name> <ingress_id> --component-routes 'downloads: hostname=<custom_hostname>;tlsSecretRef=<secret_name>'where:
<custom_hostname>-
Specifies the custom hostname for the downloads page, for example,
my-custom-hostname.dev. <secret_name>- Specifies the name of the TLS secret you created for the downloads page.
NoteYou can update both routes by running the following single command:
$ rosa edit ingress -c <cluster_name> <ingress_id> --component-routes 'console: hostname=<custom_hostname>;tlsSecretRef=<secret_name>, downloads: hostname=<custom_hostname>;tlsSecretRef=<secret_name>'
Verification
Verify the ingress is updated by running the following command:
$ rosa list ingress -c <cluster_name>Example output
ID APPLICATION ROUTER PRIVATE r218 https://openshift-console.apps.rosa.dy5e.p1.my-custom-hostname.dev true- Add your certificate to the truststore on your local system, then confirm that you can access your components at their new routes by using your local web browser.