Description of problem:
In 3.x, when you hit the root of the API server (/) in a web browser, it will redirect you to the openshift-console, if installed:
This functionality seems to be missing from 4.x. This makes it more difficult to access the console if you are logged into the CLI, as you either have to:
- Manually construct the console URL based on defaults, and hope it works
- Have cluster-admin and access the consoles.config.openshift.io/cluster CR, and pull the .status.consoleURL value
- Have access to the openshift-console NS and pull the configuration from the configmap or routes
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Get API server URL (`oc status`, `oc cluster-info`, `oc config view`)
2. Open the URL in a web browser
Get presented with list of API groups
Get redirected to the openshift-console
Spoke to deads about this one as I was trying to identify the "proper" way for OCP users to get to the console (the other methods I describe may not be available to users who are not cluster-admin). He said that the API server should be doing this redirect, and if it's not, that should be fixed.
Hi, we have a new command for getting the console URL.
$ oc whoami --show-console
Any authenticated user can run this command. Is this sufficient?
We had not planned to add the redirect since the console URL is publicly available, although it's something we could add back at this point. I'd argue the console URL is now as easy to get as the API server URL, so the redirect seems less important.
We can also consider printing the URL at other times, maybe after `oc login`.
Thanks for passing on the information in the new command. Yes, if I compile oc from HEAD, I see the new flag (it does not appear to be available in the currently released version of oc).
My initial thought is that if it is not difficult to add the redirect back in, then that would be good. Not only does it provide a safe default assumption (where is my oc pointing at, can I point my browser at that), but the API server URL is in a number of places already (oc login, oc status, oc cluster-info, kubeconfig, etc). It would also provide a smooth transition for those coming from 3.x, as that's the default there.
If it is difficult or undesirable to accomplish the redirect in 4.x, then the discoverability of the console URL via the CLI should be increased. The places I've listed above (oc login, oc status, oc cluster-info) should be at least considered to post the console URL or hint at the correct command.
The new command should also probably be documented, as the current docs only tell you to look at the initial installer logs for the console URL: https://docs.openshift.com/container-platform/4.1/web-console/web-console.html
I think the best experience is making the console URL easier to discover for CLI users, possibly printing it out on login.
I'm not sure if a redirect is the right thing. It's how things worked for 3.x, but that is more a holdover from when console was part of the API server. Since we don't support in place upgrades from 3.x -> 4.x, we won't be breaking any existing links. If there is a time to change this, it is in 4.x.
Moving out to 4.3 for now since the console URL is discoverable by normal users and this is not a regression from 4.1.
This is tracked by RFE https://jira.coreos.com/browse/RFE-58
Since it's possible to discover the URL from the CLI, the installer prints the console URL, and the current behavior works as intended, we'll track this as an enhancement.