odo icon indicating copy to clipboard operation
odo copied to clipboard

`odo describe component`: List Routes/Ingresses deployed by `odo deploy`

Open kadel opened this issue 3 years ago • 3 comments

/kind user-story

User Story

  • As an odo user
  • I want to be able to list Routes/Ingresses URLs that were deployed after executing odo deploy
  • So that I know where I can access my application.

Context

Users that went through the Quickstart Guide were wondering how to access their application. For Kubernetes Ingresses, this is fine since the user knows which domain name they used; But for Openshift Routes, the URL is generated automatically; the user currently has no way to get the routes, apart from running oc get routes or navigating to the Openshift web console.

Acceptance Criteria

  • [ ] It should list the Ingresses and Routes. See examples below.
  • [ ] Ingresses and Routes must be visible only if the running mode contains "Deploy"
  • [ ] It should include such information in the JSON output as well
  • [ ] We should update the Quickstart Guide accordingly, by showing how to access the deployed application

Examples

❯ odo describe component

Name: my-java-maven-springboot
Display Name: Spring Boot®
Project Type: spring
Language: java
Version: 1.1.0
Description: Spring Boot® using Java
Tags: Java, Spring

Running in: Dev, Deploy

Forwarded ports:
 •  127.0.0.1:40002 -> tools:8080

Supported odo features:
 •  Dev: true
 •  Deploy: true
 •  Debug: true

Container components:
 •  tools

Kubernetes components:
 •  outerloop-deployment
 •  outerloop-service
 •  outerloop-k8s-url
 •  outerloop-ocp-url

Kubernetes Ingresses:
 •  my-java-springboot-app-ingress: java-springboot.example.com

OpenShift Routes:
 •  my-java-springboot-app-route: my-java-springboot-app-default.apps.ci-ln-8zbptfk-72292.origin-ci-int-gce.dev.rhcloud.com

Note that we can have a list of hosts for the same ingress or route. So the human-readable output could be a comma-separated list of hosts.

Example JSON output:

{
--- Other fields omitted for brevity ---

        "runningIn": ["Dev", "Deploy"],
        "ingresses": [
            {
               "name": "my-java-springboot-app-ingress",
               "hosts": [
                    "java-springboot.example.com"
                ]
            }
         ],
        "routes": [
            {
               "name": "my-java-springboot-app-route",
               "hosts": [
                   "my-java-springboot-app-default.apps.ci-ln-8zbptfk-72292.origin-ci-int-gce.dev.rhcloud.com"
               ]
            }
         ],
        "managedBy": "odo"
}

Notes

The Devfile might define Custom Resources (CRs) that would translate into Ingresses or Routes once deployed with odo deploy. From the odo side, there is no way to know whether a CR would create Ingresses or Routes later. This is fine for now; we limit the scope of this issue to Ingresses / Routes explicitly defined in the Devfile.

Links

  • Related Epic (mandatory): #5994

/kind user-story

kadel avatar Jul 29 '22 11:07 kadel

Needs more information.

Possibly use odo describe ?

cdrage avatar Aug 04 '22 12:08 cdrage

@kadel

  1. Should this have a different behavior for when Devfile is accessible and inaccessible?
  2. Should this also take into account OpenShift Ingresses?

valaparthvi avatar Oct 17 '22 13:10 valaparthvi

  • Should this have a different behavior for when Devfile is accessible and inaccessible?

Yes. This information doesn't require any information from the devfile. Listing Routes and Ingressis should be done based on the information from the cluster.

  • Should this also take into account OpenShift Ingresses?

yes, by default, it should look for Ingress and Route

kadel avatar Oct 17 '22 13:10 kadel