Files
selfheal-lab-gitops/vm/harness
seon 7ce2dc68fe feat: AI VM stack (WP-12) and Alloy telemetry on k8s, legacy and DB VMs (WP-15)
WP-12(실험 설계서 6장) vm/ai-env: apply.sh(시크릿 4종을 Secret Manager에서 파일로, 미등록이면
성능 저하 모드로 기동), compose(agent 8080·hitl 8081·rag-db pgvector 0.8.7-pg16), ai.env(Discord
서버 Selfheal Lab 1557424985793101824, approvals 1557425140302872698, escalation 1557425282363691048,
OPENAI_MODEL gpt-6.1-sol 후보), 프롬프트 3종, 러너북 11종(조치별·토폴로지·3층 절차).

WP-15(실험 설계서 4.1·4.3): apps/alloy.yaml(Alloy Helm 1.13.0 DaemonSet, 클러스터링으로 KSM·Argo CD·
cadvisor 스크랩 분산, demo 등 파드 로그 → Loki), apps/kube-state-metrics.yaml(Helm 8.6.0).
legacy-api compose에 Alloy 사이드카(up{job="legacy-api"}, 컨테이너 로그). DB VM은
vm/postgres-common/alloy.sh로 apt 설치 + prometheus.exporter.postgres(pg_replication_lag_seconds)
+ custom query pg_is_wal_replay_paused + PostgreSQL 로그.

vm/harness/apply.sh: 준비 대기 루프의 curl에 || true(러너 재기동 순간 curl 56으로 중단되던 문제,
2026-10-08 harness-sync 실측).
2026-10-08 01:47:38 +09:00
..

vm/harness

Harness VM (10.20.0.11) of the self-healing lab: experiment design 5 (runner, measure DB, blackbox, k6) plus Alloy.

file purpose
apply.sh boot / make vm-sync entry: secrets from Secret Manager to /opt/selfheal/harness/secrets, env file, compose up
compose.yaml runner (8080), measure-db, blackbox (9115), alloy (12345), k6 (profile campaign)
image.tag runner image tag (selfheal-public/harness:<sha> built from selfheal-lab-apps/harness)
scenarios/*.yaml the 12 scenarios of design 7, loaded by the runner at start
config.alloy blackbox + runner scrape -> Mimir remote_write
blackbox.yaml http_2xx (ALB /api/orders, label target=alb) and tcp_connect (target=db-primary)
k6/load.js background load 20 rps (design 5.5)

Runner API (design 5.2):

endpoint use
GET /selfcheck measure DB, k8s (chaos-mesh pods), AWS OIDC caller identity, GCP instances, Mimir probe, ALB
POST /runs {"campaign","scenario_ids":[...],"baseline_s","cooldown_s","observe_timeout_s","min_observe_s","drift_before"} start a run (one at a time)
GET /runs, GET /runs/{id}, POST /runs/{id}/abort, POST /runs/{id}/finish {"drift_after"} inspect / stop / close
POST /hooks/alert Grafana contact point
POST /proposals AI VM registers a layer-2 proposal; returns the approval token
POST /actions/execute {"action_id","target","token"} catalogue action with a human token or an approved proposal token
GET /actions/catalog, GET /scenarios, GET /metrics reference

Campaign load: docker compose --env-file /opt/selfheal/harness.env --profile campaign up -d k6 (stop: ... stop k6; exit code and /logs/summary.json in the k6-logs volume).