Skip to main content

API Gateway

Manage how to expose your APIs.


Introduction

In Traefik Hub, an API Gateway is the main entry point to all your APIs.
This is where you define the public domains for your APIs and which APIs and API Collections you want to expose via an API Access.

info

You can only publish an API or API Collection once you have an API Access and a matching Gateway defined.

Managing Gateways Using CRDs

The API Gateway object has several properties.

FieldDescriptionRequired
apiAccessesList of allowed API Accesses for the Gateway.Yes
customDomainsConfigure a custom domain name for the API Gateway, for example api.example.com.
This is an optional setting, if not configured, Traefik Hub will generate a random domain under the traefikhub.io namespace.
You can control the generation of traefikhub.io domains in the workspace settings.
No

Example

A Gateway with four API Accesses and two custom domains
apiVersion: hub.traefik.io/v1alpha1
kind: APIGateway
metadata:
name: my-gateway
labels:
area: crm
spec:
apiAccesses: # API Accesses handling user and groups permissions to the Gateway
- customer-admin
- crm-collections
- crm-apis
- custom-pick
customDomains: # Custom domains to reach the API Gateway
- api.example.com
- www.api.example.com