Files
service-catalog/manifests/helm/cnpg-cluster/1.1.0/dip-values.yaml
T
wbsong111 b9e94a054a cnpg-cluster 1.1.0 — postInitApplicationSQLRefs 노출
앱별 부트스트랩 SQL 을 ConfigMap/Secret 참조로 실행할 수 있게 한다. CNPG CRD 에는
이미 있는 필드(operator 0.29.0/CRD 확인됨)인데 차트가 렌더하지 않아 values 로 쓸 수
없었다.

용도: 스키마 덤프처럼 큰 SQL 을 values 에 인라인하지 않고 ConfigMap 으로 넘기는 경우.
postInitApplicationSQL(인라인)과 시점·권한이 동일(클러스터 생성 직후 1회, 앱 DB 안에서
superuser) 하고 SQL 출처만 다르다. 1회성이라 비멱등 SQL(CREATE TABLE 등)을 그대로
넣어도 재실행되지 않는다.

- values.yaml: bootstrap.initdb.postInitApplicationSQLRefs 추가(configMapRefs/secretRefs,
  기본 빈 배열)
- templates/cluster.yaml: 값이 있을 때만 렌더(있으면 렌더, 없으면 필드 자체가 안 나옴 —
  기존 클러스터에 영향 없음을 렌더 테스트로 확인)
- CUSTOM-README.md: postInitApplicationSQL 과의 차이·참조 처리 순서(Secret 전체 →
  ConfigMap 전체) 문서화

카탈로그 관례 파일(BUILD-README·CUSTOM-README 본문 대부분·dip-*.yaml·custom-values.yaml)은
1.0.0 에서 그대로 승계했다(diff 로 확인).

검증: 빈 값일 때 필드 미노출, configMapRefs 지정 시 정상 렌더, 기존 1.0.0
custom-values.yaml 로 1.1.0 렌더해도 문제없음(하위 호환) 확인.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 11:24:23 +09:00

111 lines
2.4 KiB
YAML

# cnpg-cluster — DIP 플랫폼 기본 배포값 (멀티 테넌트 운영 기준)
instances: 3
postgresql:
# custom-values.yaml 과 동일하게 SUSE BCI 15.7 자체 빌드를 쓴다.
# 근거·비용 → doc/decisions/0001-cnpg-postgresql-image.md
# trivy 는 SLES 15.7 을 정상 커버한다(2026-07-29 재측정 — doc/analysis/sles-oval-measurement.md).
# 실효 C/H 0/0, 게이트 PASS.
imageName: "docker.io/paasup/cnpg-postgresql:18.4-bci15.7-hardened-20260803"
parameters:
max_connections: "200"
shared_buffers: 512MB
work_mem: 16MB
maintenance_work_mem: 256MB
effective_cache_size: 3GB
log_timezone: Asia/Seoul
timezone: Asia/Seoul
# 감사 로깅 — pgaudit 대상 지정
pgaudit.log: "ddl, role, write"
pgaudit.log_catalog: "off"
pgaudit.log_parameter: "on"
sharedPreloadLibraries:
- pgaudit
- pg_stat_statements
# 운영 환경은 최소 1개 동기 복제본을 요구한다.
synchronous:
method: any
number: 1
primaryUpdateStrategy: unsupervised
primaryUpdateMethod: switchover
storage:
size: 100Gi
storageClass: longhorn
walStorage:
enabled: true
size: 50Gi
storageClass: longhorn
resources:
requests:
cpu: "1"
memory: 4Gi
limits:
cpu: "4"
memory: 8Gi
bootstrap:
initdb:
database: appdb
owner: appuser
# 플랫폼은 Infisical 로 자격증명을 주입한다.
secretName: "$INFISICAL_SECRET"
encoding: UTF8
postInitApplicationSQL: []
databases:
- name: appdb
owner: appuser
ensure: present
reclaimPolicy: retain
extensions:
- name: pg_stat_statements
- name: pgaudit
enableSuperuserAccess: false
affinity:
enablePodAntiAffinity: true
# 운영 클러스터는 노드 수 >= instances 이므로 required 로 노드 분산을 강제한다.
podAntiAffinityType: required
topologyKey: kubernetes.io/hostname
nodeSelector: {}
tolerations: []
monitoring:
enablePodMonitor: true
backup:
enabled: true
retentionPolicy: 30d
barmanObjectStore:
destinationPath: "s3://dip-pg-backup/cnpg"
endpointURL: ""
s3Credentials:
accessKeyId:
name: pg-backup-s3
key: ACCESS_KEY_ID
secretAccessKey:
name: pg-backup-s3
key: ACCESS_SECRET_KEY
scheduledBackup:
enabled: true
schedule: "0 0 2 * * *"
pooler:
enabled: true
instances: 2
type: rw
poolMode: transaction
parameters:
max_client_conn: "1000"
default_pool_size: "25"