Consul
API gateways overview
This topic provides overview information about API gateways in Consul.
Introduction
API gateways enable external network clients to access applications and services running in a Consul datacenter. Consul API gateways can also forward requests from clients to specific destinations based on path or request protocol. Systems that access services in the mesh may be internal or external to your organizational network. North-south traffic is a common term to describe this type of network traffic.
API gateway use cases
API gateways solve the following primary use cases:
- Control access at the point of entry: Set the protocols of external connection requests and secure inbound connections with TLS certificates from trusted providers, such as Verisign and Let's Encrypt.
- Simplify traffic management: Load balance requests across services and route traffic to the appropriate service by matching one or more criteria, such as hostname, path, header presence or value, and HTTP method.
Workflows
You can deploy API gateways to networks that implement a variety of computing environments:
- Services hosted on VMs
- Kubernetes-orchestrated service containers
- Kubernetes-orchestrated service containers in OpenShift
The following steps describe the general workflow for deploying a Consul API gateways:
- Install Consul in your cluster/datacenter.
- VM users can refer to Deploy Consul server on virtual machines.
- Kubernetes users can refer to Install Consul on Kubernetes.
- For Kubernetes-orchestrated services on OpenShift, you must also enable the
openShift.enabledparameter.
- Define and deploy the API gateway configurations to create the API gateway artifacts.
- VM users need to create configuration entries for the gateway service, listeners configurations, and references to TLS certificates.
- For Kubernetes-orchestrated environments, configurations also include
GatewayClassConfigandparametersRefparameters.
- Define and deploy routes between the gateway listeners and services in the mesh.
Gateway configurations are modular, so you can define and attach routes and inline certificates to multiple gateways.
API gateways on virtual machines (VMs)
API gateways on VMs contains detailed workflow and guidance for configuring an API gateway in your VM based environment.
API gateways on Kubernetes
API gateways on Kubernetes contains detailed workflow and guidance for configuring an API gateway in your Kubernetes cluster.