The Gateway's role is to centralize all incoming connections to your stack. If you need to expose your Stack to the outside, it is necessary to route all the traffic through it.
Gateway Object#
You can find all the available parameters in the comprehensive CRD documentation.
apiVersion: formance.com/v1beta1
kind: Gateway
metadata:
name: formance-dev
spec:
stack: formance-devExpose the Gateway with Ingress#
To expose the Gateway to the outside, we will use an Ingress object. The Ingress will be the entry point to your stack.
apiVersion: formance.com/v1beta1
kind: Gateway
metadata:
name: formance-dev
spec:
stack: formance-dev
ingress:
host: YOUR_DOMAIN
scheme: http|httpsServing on Multiple Hosts#
You can serve a stack on multiple hostnames by adding the hosts field alongside host. The ingress will contain a rule for each host, and TLS will cover all of them.
apiVersion: formance.com/v1beta1
kind: Gateway
metadata:
name: formance-dev
spec:
stack: formance-dev
ingress:
host: app.example.com
hosts:
- app.example.org
- app.example.net
scheme: httpsAdditional hosts can also be provided via a Settings resource using the gateway.ingress.hosts key. Hosts from the setting are merged with those defined on the Gateway CRD. The {stack} placeholder is replaced with the stack name.
apiVersion: formance.com/v1beta1
kind: Settings
metadata:
name: gateway-extra-hosts
spec:
key: gateway.ingress.hosts
stacks:
- '*'
value: "{stack}.example.com, {stack}.example.org"