Bootstrap FreeKB - OpenShift - List Ingress Route using the oc get ingress command
OpenShift - List Ingress Route using the oc get ingress command

Updated:   |  OpenShift articles

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

An OpenShift route or an Ingress route will provide a URL such as http://my-route-my-project.apps.openshift.example.com:8080 which is used to route a request onto a service, which is then routed onto a pod, and then to the container in the pod, and finally to the application running in the container.

 

Like this.

 

The oc get ingress command can then be used the list the Ingress routes in the project/namespace.

~]$ oc get ingress
NAME               CLASS    HOSTS                   ADDRESS   PORTS   AGE
my-ingress-route   <none>   openshift.example.com             80      4s

 

The oc describe ingress command can be used to show more details about the ingress route.

~]$ oc describe ingress my-ingress-route
Name:             my-ingress-route
Namespace:        my-project
Address:          
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host                    Path  Backends
  ----                    ----  --------
  openshift.example.com  
                          /my-endpoint  my-service:8080 (10.131.4.14:8080)
Annotations:              <none>
Events:                   <none>

 

Or, the oc get ingress command with the --output json or --output yaml option can be used.

~]$ oc get ingress my-ingress-route --output yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  creationTimestamp: "2022-09-13T01:57:37Z"
  generation: 1
  name: my-ingress-route
  namespace: my-project
  resourceVersion: "492868937"
  uid: 71de4de0-368c-4e72-8a7d-ee202a076727
spec:
  rules:
  - host: openshift.example.com
    http:
      paths:
      - backend:
          service:
            name: my-service
            port:
              number: 8080
        path: /my-endpoint
        pathType: Exact
status:
  loadBalancer: {}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 92c12c in the box below so that we can be sure you are a human.