--- date: 2026-04-05 topic: K3s 데이터스토어 Supabase → 로컬 Patroni PostgreSQL HA 이전 areas: - infra/postgresql-ha.md - infra/infra-hosts.md tags: [history, k3s, postgresql, patroni, supabase, migration] --- K3s kine 데이터스토어를 Supabase Free tier에서 로컬 Patroni PostgreSQL 3노드 HA 클러스터로 이전. ## 배경 Supabase Free tier max_connections=60 제한, 싱가포르 리전 ~70ms 레이턴시. 로컬 PostgreSQL HA로 전환하여 성능/안정성 개선. ## 변경 사항 - Patroni 3노드 구성: postgres-1(hp2), postgres-2(kr1), postgres-3(kr2) - etcd DCS 클러스터: etcd-nas(NAS Docker), etcd-hp2(hp2 Incus), etcd-jp1(jp1 Incus) - OpenWrt HAProxy에 PostgreSQL frontend/backend 추가 (Patroni REST API `/primary`로 Leader 자동 감지) - K3s config: `datastore-endpoint: "postgres://kine:kine@192.168.9.1:5432/kine"` - hp2가 control-plane에서 worker(k3s-agent)로 전환 ## 영향 / 검증 - K3s API 정상 동작 확인 - failover 시 HAProxy가 ~3초 내 새 Leader 감지 ## 참조 - `infra/postgresql-ha.md` — 현재 Patroni HA 구성 - `history/2026-03-24-k3s-postgresql-migration.md` — 이전 단계 (외부 etcd → Supabase)