Development / Testing
In addition to running a native binary as described in the quick start guide, there are three options for running a Liftbridge cluster locally for development and testing purposes:
- Docker - single-node Liftbridge cluster backed by a single-node NATS cluster in one container
- Docker Compose - three-node Liftbridge cluster backed by a single-node NATS cluster in separate containers
- Kind (Kubernetes in Docker) - three-node Liftbridge cluster backed by a three-node NATS cluster running inside a local Kubernetes cluster
There is a container image available which runs an instance of Liftbridge and NATS inside a single Docker container for development and testing purposes. In effect, this runs a single-node Liftbridge cluster on your machine.
Use the following Docker commands to run the container:
docker pull liftbridge/liftbridge-docker docker run -d --name=liftbridge-main -p 4222:4222 -p 9292:9292 -p 8222:8222 -p 6222:6222 liftbridge/liftbridge-docker
This will run the container which will start both the NATS and Liftbridge servers. To check the logs to see if the container started properly, run:
docker logs liftbridge-main
When running the container, you can optionally specify the mount point with:
This container exposes several ports described below.
Liftbridge server exposes:
- 9292 for clients connections
NATS server exposes:
- 4222 for clients connections
- 8222 as an HTTP management port for information reporting and monitoring
- 6222 is a routing port for clustering
This will bring up three Liftbridge containers and one NATS node using Docker Compose:
To tear it down, run:
To provision a local Kind cluster, run:
Then deploy the manifests including the NATS operator and the Liftbridge cluster with:
To export the
KUBECONFIG environment variable and point kubectl to the right
After running this, you can then use kubectl as normal to interact with the local Kubernetes cluster.
To tear down your local environment, run:
We'll provide guidance on production deployments when a 1.0 release rolls around.