2.3 KiB
2.3 KiB
Deployment Notes
Swarm Ingress and TLS
Gateway exposes:
- HTTP:
:8080 - gRPC:
:8081
Recommended pattern in Swarm:
- Terminate TLS at an ingress proxy (Traefik / Nginx / Envoy) on the overlay network.
- Route HTTP and gRPC to the Gateway service by port.
- Prefer L7 routing (Host + Path for HTTP, SNI for gRPC) and keep the Swarm routing mesh disabled unless you explicitly want it.
Secrets
The Swarm stack expects these secrets to exist:
gateway_jwt_secrets(comma-separated or newline-separated signing secrets)google_oidc_client_idgoogle_oidc_client_secret
The container reads them via:
GATEWAY_JWT_SECRETS_FILEGOOGLE_OIDC_CLIENT_ID_FILEGOOGLE_OIDC_CLIENT_SECRET_FILE
Internal mTLS (Optional)
Gateway can be configured to use mTLS when calling internal upstreams.
HTTP upstream (reqwest):
GATEWAY_INTERNAL_CA_CERT_PEM_FILEGATEWAY_INTERNAL_IDENTITY_PEM_FILE(combined cert + key PEM)
gRPC upstream (tonic):
GATEWAY_INTERNAL_GRPC_TLS=true|false(or usehttps://upstream URLs)GATEWAY_INTERNAL_GRPC_CA_CERT_PEM_FILEGATEWAY_INTERNAL_GRPC_CLIENT_CERT_PEM_FILEGATEWAY_INTERNAL_GRPC_CLIENT_KEY_PEM_FILE
HA Validation (Manual)
With gateway running at replicas: 2:
- Verify
/readystays healthy during rolling updates. - Verify refresh rotation works across replicas (no sticky sessions):
- Sign in → refresh from one replica → refresh again against the other replica and confirm the old token is rejected.
- Verify admin IAM changes are visible across replicas:
- Create a role/assignment via
/admin/iamon one replica → call an authorized endpoint via the other replica.
- Create a role/assignment via
Suggested Procedure
- Deploy the stack:
docker stack deploy -c swarm/stacks/platform.yml cloudlysis
- Confirm
gatewayhas 2 running tasks:docker service ps cloudlysis_gateway
- Smoke readiness (at least one replica reachable through ingress):
curl -fsS http://localhost:8080/ready
- Refresh across replicas:
- Run the refresh flow twice while forcing traffic to different replicas (hostnames or per-task published ports if you use an ingress proxy).
- Rolling update guard:
- Update the image tag and redeploy, then watch:
docker service ps cloudlysis_gatewaycurl -fsS http://localhost:8080/readyin a loop
- Update the image tag and redeploy, then watch: