Gloo has a powerful routing engine that can handle simple use cases like API-to-API routing as well as more complex ones like HTTP to gRPC with body and header transformations. Routing can also be done natively to cloud-function providers like AWS Lambda, Google Cloud Functions and Azure Functions.
Gloo can route requests directly to functions, which can be: a serverless function call (e.g. Lambda, Google Cloud Function, OpenFaaS function, etc.); an API call on a microservice or a legacy service (e.g. a REST API call, OpenAPI operation, XML/SOAP request etc.); or publishing to a message queue (e.g. NATS, AMQP, etc.). This unique ability is what makes Gloo the only API gateway that supports hybrid apps, as well as the only one that does not tie the user to a specific paradigm.
This document is meant to provide a high-level overview of how routing works in Gloo, and some starting points to dig deeper into concepts like Upstreams, Virtual Services, and Gateway Configuration.
Let’s see what underpins Gloo routing with a high-level look at the layout of the Gloo configuration. This can be seen as 3 layers: the Gateway listeners, Virtual Services, and Upstreams. Mostly, you’ll be interacting with Virtual Services, which allow you to configure the details of the API you wish to expose on the Gateway and how routing happens to the backends. Upstreams represent those backends. Gateway objects help you control the listeners for incoming traffic.
Configuring the routing engine is done with defined predicates that match on incoming requests. The contents of a request, such as headers, path, method, etc., are examined to see if they match the predicates of a route rule. If they do, the request is processed based on enabled routing features and routed to an Upstream destinations such as REST or gRPC services running in Kubernetes, EC2, etc. or Cloud Functions like Lambda. In the Virtual Services section we’ll dig into this process further.
Examples and Concepts
Now that you have a basic framework for understanding what Gloo routing does, let’s get started with a Hello World example. Once you’re comfortable implementing a basic configuration, you can move to more advanced use cases and expand your understanding of core concepts in Gloo like Virtual Services and Configuring TLS.
Hello World: Follow this guide for hands on, step-by-step tutorial for creating your first virtual service and routing rules in Kubernetes.
Virtual Services: Virtual Services define a "virtual API" that gets exposed to clients along with a set of routing rules to backend upstream services/functions.
Configuring Downstream and Upstream TLS: Configure Gloo to serve and terminate TLS to downstream clients, as well as initiate upstream connections using upstream TLS.
Gateway Configuration: Gloo allows you to configure properties of your listeners with the Gateway resource and accompanying plugins. These guides show you how to apply these advanced listener configurations to refine your gateways' behavior.
TCP Proxy: In this tutorial, we'll take a look at using gloo as a TCP proxy.
Config Reporting & Validation: (Kubernetes Only) Gloo can be configured to validate configuration before it is applied to the cluster. With validation enabled, any attempt to apply invalid configuration to the cluster will be rejected.