Skip to main content

API Gateway Reference

A Gateway is the entry point of traffic for one environment. It has a load balancer of its own, and one or several access points through which API Instances and Auth Gateways are reached.

Gateway Routing

Rationale: What a gateway is for.

Create a gateway​

Open API Manager, go to Gateways, then create one. Two things are asked for.

Exposure mode​

The exposure mode decides from where the gateway can be reached. It determines the kind of load balancer the gateway gets, and cannot be worked around with a policy: a gateway that is not exposed to the internet is unreachable from it, whatever its routes.

ModeWho can reach the gateway
PublicAnyone on the internet. This is the default.
PrivateYour private network only.
InternalOnly what runs inside the platform.

Access points (listeners)​

An access point is a port the gateway listens on, with the kind of traffic it takes. A gateway starts with one HTTP access point on port 80; add the ones you need.

KindTrafficDefault portWhat the gateway does
HTTPStandard web traffic80Reads the requests, unencrypted
HTTPSEncrypted web traffic443Ends the encryption, with a certificate you choose
TLSEncrypted traffic passed through8443Forwards without decrypting: the backend holds the certificate
TCPRaw TCP connections8080Forwards the connection as it is

For each access point:

  • Name: lowercase letters, digits and hyphens. APIs choose an access point by this name.
  • Domain: only accept traffic for this domain. Leave it empty to accept every domain. Not asked for a TCP access point.
  • Certificate. Required for HTTPS: a stored configuration of the kind TLS Certificate. Choose an existing one or create it from the field.
  • Who may publish on it: by default, only what belongs to the same environment.
HTTPS is where encryption ends

With an HTTPS access point, the gateway holds the certificate and your services receive plain HTTP. Use TLS instead when the service must hold the certificate itself.

Listener domains​

The domain of an access point is chosen among the custom domains of the business unit and the platform domain of the cluster. Each is offered in two forms:

Choice shownHost name of the listenerAddresses of the APIs
{api-name}.example.com*.example.comOne host name per API: orders.example.com
<gateway>.example.com/{path}<gateway>.example.comOne address, one path per API: <gateway>.example.com/orders

One more choice is always offered, marked internal: the address of the gateway inside the platform, <gateway>.<namespace>. It is what to choose for an access point reached only from inside the platform.

A custom domain must be applied and delegated before its names resolve, and an HTTPS access point on it needs a certificate covering its host names: see Attach a domain to a gateway access point.

TLS passthrough hides the request from the gateway

On a TLS access point the gateway forwards encrypted bytes. It cannot read the path or the headers, so path routing and HTTP policies (authentication, rate limit, headers) do not apply. Use HTTPS unless the backend must terminate TLS itself.

Gateway settings​

Once created, a gateway is tuned through its settings.

SettingWhat it doesDefaults
Access pointsAdd, change or remove access points.One HTTP access point, port 80
ResourcesNumber of instances, and the CPU and memory of each.2 instances, 100m / 128Mi requested, 500m / 256Mi at most
AutoscalingAdd instances when CPU use rises above a target, and remove them when it falls.2 to 10 instances, at 80% CPU
ShutdownHow long an instance waits for the connections in progress before stopping.—

Routes attached to a gateway​

  • API Instances: your APIs, each on an access point.
  • Auth Gateways: the identity provider of the environment (OpenID Connect, JWT), on an HTTPS access point.

Policies can be attached to the whole gateway, in which case they apply to everything published on it, or to one API only.

Every gateway also produces access logs, traces and metrics, visible in Monitoring.