Implemented the minimum-viable endpoints needed for Kubernetes probes and operator inspection:
- Config loading: file → env → CLI overlay with validation
- JSON structured logging to stdout (plan §10 format)
- Two axum listeners: :7700 (client API) + :9090 (metrics, unauthenticated)
- Signal handlers for graceful shutdown (SIGTERM drains in-flight requests)
Endpoints implemented:
- GET /health - Meilisearch-compatible liveness probe (200, no auth, returns {"status":"available"})
- GET /version - Returns Meilisearch version from any healthy node (60s TTL cache)
- GET /_miroir/ready - Readiness probe (503 until covering quorum reachable)
- GET /_miroir/topology - Full cluster state per plan §10 JSON shape
- GET /_miroir/shards - Shard → node mapping table
- GET /_miroir/metrics - Admin-key-gated Prometheus metrics mirror
Acceptance criteria verified:
- curl localhost:7700/health returns 200 within 100ms of process start ✓
- curl localhost:7700/_miroir/ready returns 503 until all nodes reachable ✓
- curl -H "Authorization: Bearer $ADMIN_KEY" localhost:7700/_miroir/topology matches plan §10 shape ✓
- SIGTERM drains in-flight requests ✓
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
20 lines
374 B
YAML
20 lines
374 B
YAML
master_key: "test-master-key"
|
|
node_master_key: "test-node-key"
|
|
admin:
|
|
api_key: "test-admin-key"
|
|
shards: 16
|
|
replication_factor: 1
|
|
replica_groups: 1
|
|
nodes:
|
|
- id: "meili-0"
|
|
address: "http://localhost:8700"
|
|
replica_group: 0
|
|
task_store:
|
|
backend: sqlite
|
|
path: "/tmp/miroir-test.db"
|
|
cdc:
|
|
buffer:
|
|
overflow: "drop"
|
|
search_ui:
|
|
rate_limit:
|
|
backend: "local"
|