pgcat HA 승격 (Step 0): replicas=2 + podAntiAffinity + PDB

This commit is contained in:
heimdall
2026-04-15 17:21:13 +09:00
parent ad230522be
commit a7ecd4b982
2 changed files with 79 additions and 0 deletions

View File

@@ -121,6 +121,18 @@ NocoDB, n8n 등 K3s 내부 애플리케이션은 **pgcat**(연결 풀링)을 통
nocodb/n8n → pgcat (db.svc.cluster.local:6432) → HAProxy 192.168.9.1:5432 → Patroni Leader
```
### pgcat HA 구성
`db/pgcat` Deployment는 **2 replica**, 서로 다른 K3s 노드에 강제 분산.
- `replicaCount: 2` (Helm values `values/pgcat.yaml`)
- `podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution` (topologyKey `kubernetes.io/hostname`)
- `PodDisruptionBudget` `minAvailable: 1` — 최소 1개 pod 유지 보장
- `Service` ClusterIP 로 두 endpoint 모두 등록 — 클라이언트 요청은 kube-proxy 라운드로빈
- 노드 장애 또는 롤아웃 시 나머지 replica가 트래픽 흡수. NocoDB는 일시적 `Connection ended unexpectedly` 후 자동 재연결 (drop 1회, 재시작 없음)
`ghcr.io/postgresml/pgcat:latest`. app chart 템플릿은 `affinity` / `topologySpreadConstraints` / `podDisruptionBudget` 옵션 지원 (v0.5.0+).
`db/pgcat-config` ConfigMap의 각 풀의 `shards.0.servers`**HAProxy 단일 백엔드만 가리켜야 함**:
```toml