docs(status): v1.0.1 — post-cutover hardening + image arch incident postmortem

Evening update к v1.0:
- SPOF на staging registry CLOSED (postgis-barman mirrored в repo.nstart.cloud:18.3-3.6.2-2)
- Monitoring artifacts ready (k6 prod variant, synthetic smoke + CronJob, 2 alerts)
- KafkaTopics READY=False janitorial fix (script ready)
- CI build job на 401 known-issue (manual fallback)

Section 0.1 добавлена с подробным postmortem image arch incident:
1. arm64 image из mac M-series попал в registry без --platform
2. kubelet cache на node удерживал stale arm64 layer под тем же тегом
3. Pod stuck Terminating 14 мин (CNPG gracePeriod=1800s)
Lessons закреплены в docker/postgis-barman/README.md (anti-footgun).
This commit is contained in:
Zimin A.N.
2026-05-07 22:53:32 +03:00
parent f0f84b1baa
commit 6046c5aef6
+38 -5
View File
@@ -1,7 +1,7 @@
# Состояние разработки НСИ (Ordinis ЦУОД ОДХ)
**Версия:** v1.0 (anchor v1 — production LIVE на cluster.142, Альтум переехал)
**Дата:** 2026-05-07
**Версия:** v1.0.1 (post-cutover hardening: SPOF closed, monitoring stack ready, image arch incident resolved)
**Дата:** 2026-05-07 (evening update)
**Owner:** zimin.an@nstart.space
**Окружения:**
- **prod** (192.168.100.142 / cluster.142, ✅ LIVE с Альтум traffic, blue/green cutover завершён)
@@ -47,6 +47,38 @@
- staging-as-prod decommissioned для production traffic
- staging cluster.265 теперь чисто dev environment
### 0.1. Post-cutover hardening (evening 2026-05-07)
**Артефакты добавлены:**
- `k8s/benchmark/k6-job-prod.yaml` — load test для prod (Service port :80 fix)
- `k8s/benchmark/synthetic-smoke-prod.yaml` — one-shot smoke (auth + 3 endpoints, exit code = pass/fail)
- `k8s/benchmark/synthetic-smoke-cronjob-prod.yaml` — continuous monitoring (*/30 min)
- `k8s/kafka/topic-orphan-fix.sh` — janitorial script для KafkaTopic READY=False
- prometheus-rules group `ordinis.synthetic` (2 alerts: SmokeFailed/Stale, conditional на `prometheusRule.synthetic.enabled`)
- `.gitlab-ci.yml` job `build-postgis-barman` (kaniko + REGISTRY_USER/REGISTRY auth, currently 401 — known issue, manual push fallback)
**Инцидент: postgis-barman image swap** (08:30-22:00 MSK):
1. Custom image `:18.3-3.6.2-1` запушен в `repo.nstart.cloud` с mac M-series **без `--platform linux/amd64`** → arm64 layers попали в registry
2. Catalog patched на repo.nstart.cloud → CNPG re-roll → `exec format error` → CrashLoopBackOff
3. Rollback catalog на staging URL → recovered
4. Re-push amd64 → но **kubelet cache на srvaltum01** удерживал arm64 layer под тем же тегом → retry catalog swap снова exec format error
5. Bump rev `:1``:2` → kubelet вынужден pull → cache miss → новый amd64 layer → success
6. Pod stuck Terminating ~14 мин (CNPG `terminationGracePeriodSeconds: 1800`) → `kubectl delete pod --force --grace-period=0` для recovery acceleration
**Lessons learned (закреплены в `docker/postgis-barman/README.md`):**
- `docker buildx --platform linux/amd64 --push` обязательно когда build с M-series mac
- Bump rev tag при cache invalidation needs (тот же тег + новые слои = kubelet skip)
- `terminationGracePeriodSeconds=1800` означает что graceful pod delete может висеть до 30 минут
- Verify image arch через registry API (`config.architecture`) ДО catalog swap
**Production verify (post-incident):**
- Cluster phase: "Cluster in healthy state"
- status.image: `repo.nstart.cloud/terravault/postgis-barman:18.3-3.6.2-2`
- imageID digest: `sha256:1b4b074d...` (verified amd64 manifest)
- All 11 pods Running, postgres restartCount=0, lastSuccessfulBackup preserved
**SPOF на staging registry — closed.** Если `registry.k8s.265.nstart.local` упадёт, prod не пострадает.
### Что закоммичено
**ordinis-infra (4 commits сегодня):**
@@ -88,10 +120,11 @@
### 1.2. В процессе / nice-to-have
- KafkaTopics CR показывают `READY=False` (orphaned до Kafka cluster recreate, pending strimzi.io/managed sync)
- KafkaTopics CR показывают `READY=False`. Reason: "Decreasing partitions not supported" — `cluster-prod.yaml` указал partitions=3, broker имеет больше (orphan от старого setup). Fix: `k8s/kafka/topic-orphan-fix.sh` annotate'ит `strimzi.io/managed=false` (broker continues, alerts замолкают). Apply вручную.
- Vault SASL passwords могут быть stale если Strimzi user-operator regenerated после Kafka cluster recreate — re-run `scripts/vault/populate.sh`
- `postgis-barman:18.3-3.6.2-1` image сейчас pull от staging registry (`registry.k8s.265.nstart.local`) — для resilience mirror в prod registry `repo.nstart.cloud/terravault/postgis-barman`
- k6 benchmark на prod не прогнан (smoke 50 RPS / ramp 1k / sustain 5m готов в `k8s/benchmark/k6-job.yaml`)
- ~~`postgis-barman` image SPOF на staging registry~~ ✅ **CLOSED 2026-05-07 evening:** image mirrored в `repo.nstart.cloud/terravault/postgis-barman:18.3-3.6.2-2`, prod cluster.142 pull'ит оттуда. См. секцию 0.1 ниже про инцидент.
- k6 benchmark на prod не прогнан (smoke 50 RPS / ramp 1k / sustain 5m готов в `k8s/benchmark/k6-job-prod.yaml`)
- Synthetic smoke + alerts ready (`k8s/benchmark/synthetic-smoke-cronjob-prod.yaml` + prometheus-rules group `ordinis.synthetic`) — apply manually + helm upgrade с values-prod
- Real ЦУОД data integration (отдельный epic после prod soak)
### 1.3. Roadmap (отложено)