Expose the Gateway on Kubernetes
Run the Gateway in front of a cluster with a Gateway resource, and give it a public address.
A Gateway resource runs the Gateway, Nova's HTTP front door, in front of one Constellation. Clients outside the cluster send every request to it, and it forwards each one to the node that serves the stream. It is a resource of its own because it is released on its own: upgrading the cluster never restarts the Gateway, and upgrading the Gateway never touches the cluster.
Clients see one address that stays up while nodes come and go. When the Gateway itself rolls, its pods restart one at a time, so run at least two to keep one serving.
Before you start
- A running Constellation in the same namespace; see Install Nova on Kubernetes.
- An image whose entrypoint is
novagateway: thegatewaytarget ofdeploy/docker/Dockerfile. The publishedghcr.io/supabase/novaimage startsnovad, so it does not work here. - For a public address: an ingress controller, such as the AWS Load Balancer Controller, and a certificate for your domain.
Run it inside the cluster
Apply the resource
apiVersion: nova.dev/v1alpha1
kind: Gateway
metadata:
name: edge
namespace: nova
spec:
constellationRef: nova
image: registry.example.com/nova-gateway:2026-11-22
replicas: 1
resources: { cpu: 100m, memory: 256Mi }kubectl apply -f gateway.yaml
until kubectl -n nova get deploy/edge >/dev/null 2>&1; do sleep 1; done
kubectl -n nova rollout status deploy/edgegateway.nova.dev/edge created
deployment "edge" successfully rolled outThe operator creates the Deployment a moment after the resource, hence the wait. It creates a Deployment and a Service, both named edge, on port 8080. With the chart, put the same spec under gateway.spec in the values instead. constellationRef then defaults to the Constellation's name, and the Gateway is named gateway unless you set gateway.name. Use that name in place of edge on this page.
Send a request through it
kubectl -n nova port-forward svc/edge 8422:8080 &
curl -s -X POST localhost:8422/v1/buckets/demo
curl -s -X POST localhost:8422/v1/streams/demo/events
curl -s localhost:8422/v1/streams/demo/events/records \
-d '{"records":[{"body":"hello"},{"body":"world"}]}'The last call returns the acknowledgement:
{
"start": {
"seq_num": 0,
"timestamp_ms": 1795371848316
},
"end": {
"seq_num": 2,
"timestamp_ms": 1795371848316
},
"tail": {
"seq_num": 2,
"timestamp_ms": 1795371848316
}
}The Gateway found the stream's leader and forwarded the append to it. The cluster above runs with auth off, so no token was needed.
Give it a public address
Set ingress and the operator creates an Ingress for the Gateway's Service. The class and the annotations go to your ingress controller unchanged, so the same field works with any controller.
spec:
ingress:
className: alb
domains: [nova.example.com]
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:…
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=30domains lists the DNS names your deployment owns for Nova, usually one. Each domain gives the Ingress three hosts, and the Gateway starts with one --domain for each:
kubectl -n nova get ingress edgeNAME CLASS HOSTS ADDRESS PORTS AGE
edge alb local.nova.example.com,*.b.local.nova.example.com,nova.example.com 80 5s| Host | Serves |
|---|---|
{location}.{domain} | The cluster's address, the door, in path style; here local.nova.example.com |
*.b.{location}.{domain} | Each bucket's own host, such as demo.b.local.nova.example.com |
{domain} | Every request in path style, like the door |
The certificate must carry all three names of every domain, and all of them must resolve to the load balancer. With the ALB, certificate-arn takes a comma-separated list of ARNs, one certificate per domain if you like. The wildcard makes a new bucket reachable at its host the moment it exists, with no DNS record per bucket. Clients name the domain and the location with NOVA_DOMAIN and NOVA_LOCATION. Without domains, the Ingress has one rule for every host, and the Gateway serves them all in path style. Without ingress, the Gateway stays inside the cluster.
Move to a new domain
Two domains can serve side by side, each with the same door and bucket hosts, so clients move at their own pace:
Add the new domain beside the old one
Issue a certificate for the new domain's three names, and add its ARN to certificate-arn after the old one's. Then list both domains:
spec:
ingress:
domains: [nova.example.com, nova.example.net]
annotations:
# … the other annotations as before
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:…old,arn:aws:acm:…newThe Ingress gains the new domain's three hosts, and the Gateway's pods roll, one at a time, to start with both --domain flags.
Check that both serve
Point the new names at the load balancer. kubectl -n nova get ingress edge lists six hosts, three per domain, and a client with NOVA_DOMAIN=nova.example.net reads what it read under the old domain.
Move the clients, then remove the old domain
Set NOVA_DOMAIN to the new domain in every client. Once none uses the old one, remove it from domains and its ARN from the annotation. The Gateway's pods roll again.
TLS ends at the load balancer in this example. Keep its idle timeout at 30 seconds or more: a subscription over HTTP sends a heartbeat every 15 seconds. To end TLS at the Gateway instead, name a kubernetes.io/tls Secret in tlsSecretRef.
Token checks at the Gateway
When the Constellation runs auth.mode: jwt with auth.signingKeySecret, the operator writes the public half of the key to the Secret <gateway>-jwks. The Gateway then checks every token before it forwards a request:
curl -s -H "Authorization: Bearer $TOKEN" localhost:8422/v1/streams/demo/events/records \
-d '{"records":[{"body":"x"}]}'
curl -s -H 'Authorization: Bearer not-a-token' 'localhost:8422/v1/streams/demo/events/records?seq_num=0'{"error":"dataplane: no grant covers append on demo/events"}
{"error":"auth: verify token: token is malformed: token contains an invalid number of segments"}The first token may only read demo, so the append gets 403. The second is not a token, so it gets 401. A new signing key restarts the Gateway's pods.
With the key set the operator generates, the Gateway forwards tokens unchecked. That key set is symmetric, so a Gateway that held it could also sign tokens. The nodes still check every token.
Under jwt, the Gateway also needs a credential of its own to call the nodes' fleet listener. The operator mints it, a token with the nova:gateway scope that lives 7 days, in the Secret <gateway>-fleet-credential, mints a new one at half its life, and mounts it. The Gateway reads the file again when it changes, so a new credential restarts nothing.
How the Gateway rolls
A new image or setting replaces the Gateway's pods in place, one at a time:
- A stopping pod keeps serving for 30 seconds, so the load balancer can take it out of its targets. Then the process gets 15 seconds to finish its requests.
- The new pod must stay ready for 30 seconds before it counts as available.
- With an object cache, the operator runs one Deployment per zone, named
<gateway>-<zone>, each pinned to its zone and reading through that zone's cache. The next zone rolls only once the previous one has settled.
The pods are replaced in place because a Gateway pool usually runs one machine per zone, sized for one pod, with no room for a second. With the AWS Load Balancer Controller, label the namespace elbv2.k8s.aws/pod-readiness-gate-inject: enabled. A pod then counts as ready only when its load balancer target is healthy. The Pulumi reference deployment sets the label.
The Gateway's fields
If it goes wrong
| Symptom | Likely cause | What to do |
|---|---|---|
The pod runs novad and crashes | The image starts novad | Build the gateway target and use that image |
No Deployment appears, and the operator logs gateway stray: constellation "prod": Constellation.nova.dev "prod" not found | constellationRef names no Constellation in this namespace | Fix the name |
Every request gets 401 auth: no credential | The Constellation runs jwt and the client sent no token | Give the client a key; see Give a workload an API key |
| The load balancer sends traffic to a stopping pod | The pod counted ready before its target was healthy | Add the readiness-gate label to the namespace |