kruize / kruize-ui

Kruize Autotune UI
MIT License
6 stars 12 forks source link

Incorrect Kubernetes Cluster URL in Navigation bar #215

Open shreyabiradar07 opened 1 week ago

shreyabiradar07 commented 1 week ago

Problem Faced: In the horizontal Navbar on clicking the Kubernetes logo to get cluster information there are two URLs displayed

  1. Kubernetes URL
  2. Kruize URL

In OpenShift, for Kubernetes URL currenttly Kruize-UI route URL is displayed instead of the OpenShift cluster URL

Screenshot From 2024-11-11 18-26-58

Expectations / Delivery Requirements: Fix the Kubernetes URL being displayed, replacing with OpenShift URL

Where to Start?

athiruma commented 1 week ago

AFAIK the cluster URL would look like this: <route_name>.apps.uihackathon.lab.psi.pnq2.redhat.com Which route URL do you want to display here? @bhanvimenghani

bhanvimenghani commented 1 week ago

For the kubernetes url we want it to be just the oc login https://api.uihackathon.lab.psi.pnq2.redhat.com:6443 api url, just so that the user knows which oc machine the ui is running on. and for the kruize url part we can keep it as it is for now.

athiruma commented 1 week ago

Any API that exposes the cluster url?

bhanvimenghani commented 1 week ago

Currently we dont have a backend api which provides this cluster url, afaik. @shreyabiradar07 maybe can help here.

shreyabiradar07 commented 1 week ago

@athiruma We want to display OpenShift Cluster URL, for example in minikube(screenshot attached) UI displays minikube IP for Kubernetes URL and similarly we want either the Openshift Console route URL or api-server URL to be displayed which can be fetched by running below command

Expected output- Kubernetes URL: http://console-openshift-console.apps.uihackathon.lab.psi.pnq2.redhat.com

oc get routes -n openshift-console
NAME        HOST/PORT                                                              PATH   SERVICES    PORT    TERMINATION          WILDCARD
console     console-openshift-console.apps.uihackathon.lab.psi.pnq2.redhat.com            console     https   reencrypt/Redirect   None

Minikube example:

Screenshot From 2024-11-12 18-56-35

athiruma commented 6 days ago

@shreyabiradar07, you are right. For this, we need the API in the backend to expose these url's. From the front end, we can't exec/ run commands on the cluster. It would be great to have these two API's. /api/cluster_url expose the cluster URL /api/cluster_url/console exposes the console route.

WDYT?