Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Added console basic routing guide #111

Merged
merged 7 commits into from Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions gloo/docs/user_guides/_index.md
Expand Up @@ -8,6 +8,7 @@ Follow these guides to get started using Gloo!
**API Gateway Routing:**

* [Basic Routing](basic_routing)
* [Basic Routing in Gloo Enterprise Console (Enterprise)](basic_routing_console)
* [Function Routing](function_routing)
* [External API Routing](external_api_routing)
* [Rate Limiting (Enterprise)](ratelimit)
Expand Down
Binary file added gloo/docs/user_guides/add_route.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/basic_console.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 changes: 144 additions & 0 deletions gloo/docs/user_guides/basic_routing_console.md
@@ -0,0 +1,144 @@
---
title: Basic Routing in Gloo Enterprise Console (Enterprise)
weight: 1
---

This is a quick walk through guide on using the Gloo Enterprise Console. This guide will show you how to create a route
rules (proxy) to a monolith application, and then re-directing a page request to a new microservice.

## Route Rule to an Existing Application

This example will show creating route rules in Gloo to a "Lift and Shift" monolith application hosted in Kubernetes.

1. Install example application into your Kubernetes cluster. This is the classic Spring PetClinic application that has been moved into a container.

```bash
kubectl apply \
--namespace default \
--filename https://raw.githubusercontent.com/solo-io/gloo/master/example/petclinic/petclinic.yaml
```

1. Open the Gloo Enterprise console

* If you're running `minikube`, the quick way to open the Gloo Enterprise Console is the following command, which
will automatically open the console in a browser window.

```bash
minikube service --namespace gloo-system apiserver-ui
```

You can use the `--url` option to see the url.

```bash
minikube service --namespace gloo-system apiserver-ui --url
```

* Otherwise, you can get your Kubernetes Cluster IP using `kubectl cluster-info`. In this example, my Cluster IP is
`192.168.99.102`; where the Kubernetes master is running.

```bash
kubectl cluster-info

Kubernetes master is running at https://192.168.99.102:8443
KubeDNS is running at https://192.168.99.102:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
```

And the console port number using the following. In this example, the port number is `31242`.

``` bash
kubectl get service --namespace gloo-system apiserver-ui

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
apiserver-ui NodePort 10.97.69.208 <none> 8088:31242/TCP 129m
```

So to open the Gloo Enterprise Console, in this example, I'd open a browser to `192.168.99.102:31242`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few spots in here where the first person voice feels a bit much -- "I'd open a browser", "my cluster IP". I would change these to something like:

"So to open the Gloo Enterprise Console, navigate to ... in the browser. "

"In this example, the Cluster IP is ..."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I think technical docs are usually in 3rd person / passive voice, but I don't really mind the rest (not worth changing all the "you"s, etc) especially as a user guide


1. Your console should look something like the following.

![Basic Console](../basic_console.png "Basic Console")

1. Create a new Virtual Service.

* Click on the `Create Virtual Service +` link in the upper right corner of the console.

![Create Virtual Service](../create_virtual_service.png "Create Virtual Service")

* In the New Virtual Service pop up, enter the following information.

* Name: `default`
* Add Domain: `*` and click on `+`
* Namespace: `gloo-system`
* Click Submit

![New Virtual Service](../new_virtual_service.png "New Virtual Service")

1. Add a route by right clicking in the `DEFAULT` Virtual Service, and selecting `New Route` in the pop up.

![Add Route](../add_route.png "Add Route")

* In the New Route pop up, enter the following information.

* Virtual Service: `default`
* Path: `/`
* Upstream Name: `default-petclinic-8080`
* Click Submit

![New Route](../new_route.png "New Route")

1. Test the route.

* Get Gloo gateway url. The following command will return the base url for the Gloo Gateway proxy. Since we setup
our route rules for `/` for the petclinic app, you can open your browser to the url returned by the following
command.

```bash
glooctl proxy url
```

* You should see the petclinic app in your browser

![petclinic](../petclinic.png "petclinic")

## Routing Rule to Redirect a Page Request in an Existing Application

In the petclinic application, if you click on the `Veterinarians` tab you will see a table with 2 columns. Let's say
that our team created a new microservice `petclinic-vet` that returns a new 3 column table with additional information
our customers want. This example will show how to redirect a page (HTTP GET) request such that we can enhance the
functionality of our application **without** needing to change the original monolithic petclinic application. This
allows you to provide new functionality independent of efforts to change original code.

![Petclinic Veterinarians](../petclinic-vet-original.png "Petclinic Veterinarians")

Let's create a new route rule to redirect requests to `/vets` to our new microservice

1. On the Catalog tab of the Gloo Enterprise Console, right click on the `DEFAULT` Virtual Service to add a new route.

![Add Route](../add_route.png "Add Route")

* In the New Route pop up, enter the following information.

* Virtual Service: `default`
* Path: `/vets`
* Ensure Match type is set to `PREFIX` (default)
* Upstream Name: `default-petclinic-vets-8080`
* Click Submit

![New Route Vet](../new_route_vets.png "New Route Vet")

1. On the Routes tab of the Console, on the `default` Virtual Service expand the routes, and re-order the routes so that
`/vets` is first. That way the `/vets` path prefix will be matched before `/`.

![Reorder Routes](../reorder_routes.png "Reorder Routes")

1. Test the new route by refreshing the petclinic app, and clicking on the `VETERINARIANS` tab. If the redirect route
rule is working correctly, you should now see 3 columns in the Veterinarians table.

![petclinic Vet New](../petclinic_vet_new.png "Petclinic Vet New")

## Summary

This guide hopefully gave you a taste for how Gloo Enterprise can help you solve some of your challenges. Please
look at the rest of our documentation for more information on using Gloo.
Binary file added gloo/docs/user_guides/create_virtual_service.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/function_console.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/new_route.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/new_route_vets.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/new_virtual_service.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/petclinic-vet-original.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/petclinic.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/petclinic_vet_new.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gloo/docs/user_guides/reorder_routes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.