Keep operator telemetry live-only with bounded volatile state

This commit is contained in:
DCCONSTRUCTIONS
2026-10-08 10:54:35 +03:00
parent 15a60e7e31
commit 8bf6571ce2
14 changed files with 450 additions and 570 deletions
+15 -76
View File
@@ -10,6 +10,11 @@ services:
image: eclipse-mosquitto:2.1.2-alpine
container_name: ndc-mission-core-mqtt-broker
restart: unless-stopped
logging:
driver: local
options:
max-size: "5m"
max-file: "2"
read_only: true
security_opt:
- no-new-privileges:true
@@ -33,9 +38,10 @@ services:
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
- ./runtime/mosquitto/passwords:/mosquitto/config/passwords:ro
- ./runtime/mosquitto/acl:/mosquitto/config/acl:ro
- broker-data:/mosquitto/data
tmpfs:
- /tmp:size=16m,noexec,nosuid
- /mosquitto/data:size=1m,noexec,nosuid
- /mosquitto/log:size=1m,noexec,nosuid
healthcheck:
test:
- CMD-SHELL
@@ -47,67 +53,18 @@ services:
timeout: 4s
retries: 6
timescale:
image: timescale/timescaledb-ha:pg16.14-ts2.28.2-all-oss
# The HA image auto-tunes for the Docker VM, not this 1 GiB container.
command: ["postgres", "-c", "shared_buffers=128MB", "-c", "work_mem=4MB", "-c", "maintenance_work_mem=64MB", "-c", "effective_cache_size=512MB", "-c", "max_parallel_workers_per_gather=0", "-c", "max_connections=32"]
container_name: ndc-mission-core-telemetry-timescaledb
restart: unless-stopped
security_opt:
- no-new-privileges:true
mem_limit: 1024m
pids_limit: 256
labels:
<<: *ndc-labels
com.nodedc.role: telemetry-database
environment:
POSTGRES_DB: "${MISSIONCORE_DB_NAME}"
POSTGRES_USER: "${MISSIONCORE_DB_USER}"
POSTGRES_PASSWORD: "${MISSIONCORE_DB_PASSWORD}"
volumes:
- timescale-data:/home/postgres/pgdata/data
- ./timescale/001_telemetry.sql:/docker-entrypoint-initdb.d/001_telemetry.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${MISSIONCORE_DB_USER} -d ${MISSIONCORE_DB_NAME}"]
interval: 10s
timeout: 5s
retries: 10
database-bootstrap:
image: timescale/timescaledb-ha:pg16.14-ts2.28.2-all-oss
container_name: ndc-mission-core-telemetry-bootstrap
restart: "no"
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
mem_limit: 128m
pids_limit: 64
labels:
<<: *ndc-labels
com.nodedc.role: telemetry-database-bootstrap
depends_on:
timescale:
condition: service_healthy
environment:
MISSIONCORE_DB_NAME: "${MISSIONCORE_DB_NAME}"
MISSIONCORE_DB_ADMIN_USER: "${MISSIONCORE_DB_USER}"
MISSIONCORE_DB_ADMIN_PASSWORD: "${MISSIONCORE_DB_PASSWORD}"
MISSIONCORE_DB_INGEST_PASSWORD: "${MISSIONCORE_DB_INGEST_PASSWORD}"
volumes:
- ./timescale/002_roles_and_retention.sh:/bootstrap.sh:ro
tmpfs:
- /tmp:size=16m,noexec,nosuid
entrypoint: ["/bin/sh", "/bootstrap.sh"]
normalizer:
image: nodedc/mission-core-telemetry-normalizer:local
image: ndc-mission-core-telemetry-normalizer:live-v1
container_name: ndc-mission-core-telemetry-normalizer
build:
context: ../..
dockerfile: deploy/telemetry-plane/normalizer/Dockerfile
context: ./normalizer
dockerfile: Dockerfile
restart: unless-stopped
logging:
driver: local
options:
max-size: "5m"
max-file: "2"
read_only: true
security_opt:
- no-new-privileges:true
@@ -121,10 +78,6 @@ services:
depends_on:
broker:
condition: service_healthy
timescale:
condition: service_healthy
database-bootstrap:
condition: service_completed_successfully
ports:
- "127.0.0.1:${MISSIONCORE_TELEMETRY_QUERY_PORT:-18030}:18030"
environment:
@@ -132,8 +85,6 @@ services:
MISSIONCORE_MQTT_PORT: "1883"
MISSIONCORE_MQTT_USERNAME: "${MISSIONCORE_MQTT_INGEST_USER}"
MISSIONCORE_MQTT_PASSWORD: "${MISSIONCORE_MQTT_INGEST_PASSWORD}"
MISSIONCORE_DATABASE_DSN: >-
postgresql://missioncore_normalizer:${MISSIONCORE_DB_INGEST_PASSWORD}@timescale:5432/${MISSIONCORE_DB_NAME}
MISSIONCORE_QUERY_HOST: "0.0.0.0"
MISSIONCORE_QUERY_PORT: "18030"
tmpfs:
@@ -150,18 +101,6 @@ services:
timeout: 4s
retries: 6
volumes:
broker-data:
name: ndc-mission-core-mqtt-data
labels:
<<: *ndc-labels
com.nodedc.role: mqtt-storage
timescale-data:
name: ndc-mission-core-telemetry-timescale-data
labels:
<<: *ndc-labels
com.nodedc.role: telemetry-storage
networks:
default:
name: ndc-mission-core-telemetry