PgWeb
PgWeb은 웹 브라우저에서 PostgreSQL 데이터베이스를 탐색하고 SQL을 실행할 수 있는 경량 관리 UI입니다. Lumie 인프라에서는 앱 클러스터(lumie-db 네임스페이스)의 lumie 데이터베이스에 연결되며, 공개 인그레스 없이 Teleport Web App 터널로만 접근할 수 있습니다.
개요
주요 사양
| 항목 | 값 |
|---|---|
| 이미지 | sosedoff/pgweb:0.17.0 |
| 네임스페이스 | lumie-db |
| 포트 | 8081 (컨테이너), 80 (서비스) |
| 접근 방법 | Teleport Web App 터널 (공개 인그레스 없음) |
| 연결 대상 | lumie-db-rw.lumie-db.svc:5432/lumie |
| 헬름 차트 | bjw-s/app-template v3.6.1 |
| 배포 방식 | ArgoCD (자동 동기화) |
아키텍처
설치 및 구성
Helm Values
PgWeb은 bjw-s/app-template 차트를 사용합니다.
controllers:
main:
replicas: 1
annotations:
reloader.stakater.com/auto: "true"
containers:
main:
image:
repository: zot.lumie-infra.com/sosedoff/pgweb
tag: "0.17.0"
args:
- "--bind=0.0.0.0"
- "--listen=8081"
env:
PGWEB_DATABASE_URL:
valueFrom:
secretKeyRef:
name: pgweb-db-secrets
key: database-url
resources:
requests:
cpu: 15m
memory: 100Mi
limits:
memory: 100Mi
probes:
liveness:
enabled: true
custom: true
spec:
tcpSocket:
port: 8081
initialDelaySeconds: 10
periodSeconds: 10
readiness:
enabled: true
custom: true
spec:
tcpSocket:
port: 8081
initialDelaySeconds: 5
periodSeconds: 5
pod:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: pgweb
topologyKey: kubernetes.io/hostname
service:
main:
controller: main
ports:
http:
port: 80
targetPort: 8081
ingress:
main:
enabled: false
주요 설정 설명
시작 인수
--bind=0.0.0.0 # 모든 네트워크 인터페이스에서 수신 대기
--listen=8081 # 리슨 포트
헬스 프로브
TCP 소켓 방식으로 프로세스가 포트 8081에서 수신 중인지 확인합니다.
| 프로브 | 방식 | 초기 대기 | 주기 |
|---|---|---|---|
| Liveness | tcpSocket:8081 | 10초 | 10초 |
| Readiness | tcpSocket:8081 | 5초 | 5초 |
Pod 안티 어피니티
preferredDuringSchedulingIgnoredDuringExecution으로 PgWeb Pod를 서로 다른 노드에 분산 배치합니다. required가 아닌 preferred이므로 노드 수가 부족해도 스케줄링이 차단되지 않습니다.
Reloader 통합
annotations:
reloader.stakater.com/auto: "true"
pgweb-db-secrets Secret이 갱신되면 Reloader가 자동으로 Deployment를 재시작하여 새 연결 정보를 반영합니다.