Synadia Platform
HTTP Gateway Deployment and Configuration
Docker
A Docker deployment guide leveraging Compose
This deployment method has the following prerequisites:
- Access to Docker Engine
- Docker Compose v2, built-in modern versions of the
docker
CLI - Access via Control Plane to an existing NATS system
Preparation
- Prepare the NATS access URL and make sure the NATS system is reachable from the deployment location.
- Select the port one which HTTP Gateway should be accessible.
Configure resources in Control Plane
- In Control Plane, go to
Accounts
and add a new account calledhttp-gateway
. - Click into the new account and click the
Users
tab and add a new user calledhttp-gateway
. - Click into the new user and click
Get Connected
and thenDownload Credentials
. Save the file and rename it tohttp-gateway.creds
. - Click on the
JetStream
tab and add a new KV bucket calledtokens
.
Enable HTTP Gateway in Control Plane
Back on system page, click on the Settings
page and under the HTTP Gateway
section do the following:
- Enable it
- Account: choose
http-gateway
- Token Bucket:
tokens
- External access URL:
http://<server>:<port>
Click the Submit
button at the top.
Video Walk-through
Here is a interactive walk-through for configuring the HTTP Gateway within Control Plane.
Login to Registry
Using the registry credentials you were given, login to:
docker login registry.synadia.io
Docker Compose file
Create a file called docker-compose.yaml
with the following settings:
http-gateway:
image: registry.synadia.io/http-gateway:latest
environment:
NHG_PORT: '8080'
NHG_URL: 'nats://server1:4222,nats://server2:4222,nats://server3:4222'
NHG_TOKENS_BUCKET: 'tokens'
NHG_PROVIDER_CREDS: '/http-gateway.creds'
NHG_DISABLE_LOGGING: 'false'
ports:
- 8080:8080
command:
- 'run'
volumes:
- ./http-gateway.creds:/http-gateway.creds
Environment Variable | Usage |
---|---|
NHG_PORT | Listen port of HTTP Gateway |
NHG_URL | NATS URL |
NHG_TOKENS_BUCKET | KV bucket name for state management - do not change! |
NHG_PROVIDER_CREDS | Path to HTTP Gateway provider credentials |
Start the containers
Run the following command to bring up the stack.
docker compose up -d
Upgrade the image
To upgrade Control Plane's image and restart, use the following commands:
docker compose pull http-gateway
docker compose up -d
Stop the containers
docker compose down
The container volume data can be deleted by including the -v
option:
docker compose down -v
Basic usage
Issue an API token as shown here: https://docs.synadia.com/cloud/resources/http-gateway
curl -H "Authorization: Bearer <API_TOKEN>" \
https://<your gateway>:<port>/v1/kvm/buckets