This guide walks you through running EdgeKit locally and then deploying it to a k3s cluster.
- Docker ≥ 24 (with Compose v2)
- Git
git clone https://github.com/perspikapps/edgekit.git
cd edgekit./scripts/build.sh./scripts/start-local.shExpected output:
==> Starting edgekit stack (builds images if needed)…
[+] Building …
[+] Running 2/2
✔ Container edgekit-server Started
✔ Container edgekit-client Started
✅ edgekit is running!
MQTT broker: mqtt://localhost:1883
MQTT over WS: ws://localhost:9001
View logs: docker compose logs -f
Stop: ./scripts/stop-local.sh
Open a second terminal and subscribe to all topics:
docker run --rm --network host eclipse-mosquitto:2.0 \
mosquitto_sub -h localhost -t "edgekit/#" -vYou should see JSON payloads arriving every 5 seconds:
edgekit/edge-local-1/metrics {"clientId":"edge-local-1","timestamp":"2024-01-15T10:30:00.000Z","cpu":{"loadPercent":5.12},...}
./scripts/stop-local.sh- A k3s cluster (single node is fine for testing)
- Helm ≥ 3.14
kubectlconfigured for the cluster
helm install edgekit oci://ghcr.io/perspikapps/charts/edgekit \
--namespace edgekit \
--create-namespace \
--waithelm install edgekit ./helm/edgekit \
--namespace edgekit \
--create-namespace \
--waitkubectl -n edgekit get pods
# NAME READY STATUS RESTARTS
# edgekit-server-xxxxxxxxxx-xxxxx 1/1 Running 0
# edgekit-client-xxxxxxxxxx-xxxxx 1/1 Running 0
kubectl -n edgekit logs -f -l app.kubernetes.io/component=client
# [edgekit-client] Starting — id=edgekit-client-xxxxx broker=ws://edgekit-server:9001
# [edgekit-client] Connected to ws://edgekit-server:9001
# [edgekit-client] Published to edgekit/edgekit-client-xxxxx/metricshelm upgrade edgekit ./helm/edgekit \
--namespace edgekit \
--set client.replicaCount=3helm upgrade edgekit ./helm/edgekit \
--namespace edgekit \
--set client.publishIntervalMs=10000helm uninstall edgekit --namespace edgekit
kubectl delete namespace edgekitForward the WebSocket port to your local machine:
kubectl -n edgekit port-forward svc/edgekit-server 9001:9001Then connect any MQTT-over-WebSocket client to ws://localhost:9001.
Example using mosquitto_sub with WebSocket support:
docker run --rm --network host eclipse-mosquitto:2.0 \
mosquitto_sub -h localhost -p 9001 -t "edgekit/#" -v| Variable | Default | Description |
|---|---|---|
MQTT_BROKER_URL |
ws://edgekit-server:9001 |
Full WebSocket URL of the broker |
MQTT_TOPIC_PREFIX |
edgekit |
Prefix for all published topics |
CLIENT_ID |
pod name (k8s) / edge-local-1 (compose) |
Unique agent identifier |
PUBLISH_INTERVAL_MS |
5000 |
Metrics publish interval (ms) |