The maestro server command starts the Maestro server, which is the central control plane that stores resources, provides REST/gRPC APIs, and manages communication with agents via message brokers.
The Maestro server is the central control plane that:
- Stores resources and their status in a PostgreSQL database
- Provides REST API (default port 8000) and gRPC API (default port 8090)
- Communicates with agents via message brokers (MQTT, gRPC, or Pub/Sub)
- Exposes health check (port 8083) and metrics (port 8080) endpoints
Once the server is running, the following endpoints are available:
GET /api/maestro/v1/consumers- List consumersPOST /api/maestro/v1/consumers- Create consumerGET /api/maestro/v1/consumers/{id}- Get consumerPATCH /api/maestro/v1/consumers/{id}- Update consumerDELETE /api/maestro/v1/consumers/{id}- Delete consumerGET /api/maestro/v1/resource-bundles- List resource bundlesGET /api/maestro/v1/resource-bundles/{id}- Get resource bundleDELETE /api/maestro/v1/resource-bundles/{id}- Delete resource bundle
- Resource bundle create/update/delete operations
- Real-time resource status updates
- CloudEvents-based communication
GET /healthcheck- Health check endpoint
GET /metrics- Prometheus metrics endpoint
maestro server [flags]| Flag | Default | Description |
|---|---|---|
--db-host-file |
secrets/db.host |
Database host file |
--db-port-file |
secrets/db.port |
Database port file |
--db-name-file |
secrets/db.name |
Database name file |
--db-user-file |
secrets/db.user |
Database username file |
--db-password-file |
secrets/db.password |
Database password file |
--db-sslmode |
disable |
SSL mode: disable, require, verify-ca, verify-full |
--db-max-open-connections |
50 |
Maximum open DB connections |
--enable-db-debug |
false |
Enable database debug logging |
| Flag | Default | Description |
|---|---|---|
--message-broker-type |
mqtt |
Broker type: mqtt, grpc, or pubsub |
--message-broker-config-file |
secrets/mqtt.config |
Broker config file path |
--subscription-type |
shared |
Subscription type: shared or broadcast |
| Flag | Default | Description |
|---|---|---|
--http-server-bindport |
8000 |
HTTP server port |
--enable-https |
false |
Enable HTTPS |
--https-cert-file |
- | Path to TLS certificate |
--https-key-file |
- | Path to TLS private key |
--http-read-timeout |
5s |
Read timeout |
--http-write-timeout |
30s |
Write timeout |
| Flag | Default | Description |
|---|---|---|
--enable-grpc-server |
true |
Enable gRPC server |
--grpc-server-bindport |
8090 |
gRPC server port |
--grpc-tls-cert-file |
- | Path to TLS certificate |
--grpc-tls-key-file |
- | Path to TLS private key |
--grpc-authn-type |
mock |
Auth type: mock, mtls, token |
--grpc-max-receive-message-size |
4194304 |
Max receive size (4MB) |
--grpc-max-send-message-size |
2147483647 |
Max send size (~2GB) |
| Flag | Default | Description |
|---|---|---|
--health-check-server-bindport |
8083 |
Health check port |
--metrics-server-bindport |
8080 |
Metrics port |
--enable-health-check-https |
false |
Enable HTTPS for health |
--enable-metrics-https |
false |
Enable HTTPS for metrics |
# Start PostgreSQL in Docker
make db/setup
# Verify database is running
make db/loginChoose one of the following:
# Start MQTT broker in Docker
make mqtt/setupThis starts Eclipse Mosquitto on port 1883.
# No setup required - gRPC broker is built into the server
# Just start the server with --message-broker-type grpc# Start Pub/Sub emulator in Docker
make pubsub/setup
# Initialize topics and subscriptions
# Requires: pip3 install google-cloud-pubsub
make pubsub/init# Run migrations to create database schema
./maestro migration
# Verify migrations
make db/loginExpected output:
maestro=# \dt
List of relations
Schema | Name | Type | Owner
--------+------------------+-------+---------
public | consumers | table | maestro
public | event_instances | table | maestro
public | events | table | maestro
public | migrations | table | maestro
public | resources | table | maestro
public | server_instances | table | maestro
public | status_events | table | maestro
(7 rows)# Start with MQTT broker (default)
make run
# OR start with gRPC broker
MESSAGE_DRIVER_TYPE=grpc make run
# OR start with Pub/Sub emulator
MESSAGE_DRIVER_TYPE=pubsub make run
# OR start directly with the binary
./maestro server# Check health
curl http://localhost:8083/healthcheck
# List consumers (should be empty initially)
maestro consumer list --rest-url=http://127.0.0.1:8000Expected output:
ID NAME LABELS CREATED AT
# Create a consumer
maestro consumer create cluster1 --rest-url=http://127.0.0.1:8000
# List consumers
maestro consumer list --rest-url=http://127.0.0.1:8000Expected output:
ID NAME LABELS CREATED AT
219ac81e-cd5c-4d22-9e03-e4eaa4f55aa1 cluster1 2024-01-15 10:20:14
After starting the server:
- Use the CLI consumer commands to manage consumers
- Use the CLI resourcebundle commands to deploy resources
- Deploy agents on target clusters (TODO)
- Monitor metrics at http://localhost:8080/metrics
- Check health at http://localhost:8083/healthcheck