Deployment¶
Run the scripts from src/mesh.
| Script | Purpose |
|---|---|
deploy/scripts/build.sh |
Build the images |
deploy/scripts/up.sh |
Build, create keys and configurations, and start |
deploy/scripts/smoke.sh |
End-to-end checks |
deploy/scripts/test.sh |
Unit tests |
deploy/scripts/logs.sh |
Follow logs |
deploy/scripts/down.sh |
Stop. Keeps data |
deploy/scripts/purge.sh --yes |
Delete keys and data |
deploy/scripts/k8s-deploy.sh |
Install on Kubernetes |
Local networks¶
The clusters have separate networks lan-a, lan-b and lan-c, and share only wan, with the relay and the DHT. No ports are published on the host.
| Variable | Default |
|---|---|
SUBNET |
172.31.90.0/24 |
IP_RANGE |
172.31.90.128/25 |
DHT_IP |
172.31.90.10 |
DHT_BOOTSTRAP |
172.31.90.10:49737 |
If Docker reports overlapping networks, choose another range and set all four before starting:
export SUBNET=10.231.90.0/24 IP_RANGE=10.231.90.128/25 DHT_IP=10.231.90.10 DHT_BOOTSTRAP=10.231.90.10:49737
Kubernetes¶
KUBECONFIG=~/.kube/config KUBE_CONTEXT=my-cluster deploy/scripts/k8s-deploy.sh
This creates the namespace mesh with NATS, a signing agent, the controller, secrets and a new cluster key. Then deploy a bridge through the controller. Only bridges can reach the signing agent.
Adapt deploy/k8s/mesh.yaml, especially the policy with cluster, images and patterns, before using it.
Production notes¶
- Use TLS and credentials between NATS, leaf nodes and agents.
- Use
"default": "deny"for messages. - Use several relays of different operators.
- Back up the cluster key. Other clusters must update
trustedif it changes.