kubectl: Finding the OpenShift Console URL

kubectl OpenShift Web Console route CLI console

1 min read | by Jordi Prats

When working on an OpenShift cluster, it’s common to need the Web Console URL, especially when setting up a new environment or giving access to other users.

Rather than navigating through RedHat portal or guessing the domain, you can use kubectl to directly query the route object and retrieve the console's public URL.

Run the following command to get the route for the console service (using oc it's just the same):

kubectl get route -n openshift-console console

This returns output similar to:

NAME      HOST/PORT                                                         PATH   SERVICES   PORT    TERMINATION          WILDCARD
console   console-openshift-console.example.openshiftapps.com               console    https   reencrypt/Redirect   None

You can even extract just the URL using a kubectl template:

kubectl get route console -n openshift-console -o jsonpath='https://{.spec.host}'

Either way, the full HTTPS URL to the OpenShift Console is ready to copy-paste into your browser.


Posted on 09/07/2025

Categories