# cloudnative-pg 버전 갱신 가이드 ## 1. git 작업 환경 구성 ```sh git clone https://github.com/paasup/dip-catalog.git cd dip-catalog git checkout -b update-cloudnative-pg/<신규버전> ``` ## 2. helm chart 업데이트 ### 1) 신규 버전 확인 ```sh helm repo add cnpg https://cloudnative-pg.github.io/charts helm repo update cnpg helm search repo cnpg/cloudnative-pg --versions | head ``` 차트 버전과 operator 버전(appVersion)은 다르다. 대응 관계를 반드시 확인한다. | 차트 버전 | operator(appVersion) | | --- | --- | | 0.29.0 | 1.30.0 | | 0.28.3 | 1.29.1 | | 0.27.1 | 1.28.1 | ### 2) 신규 버전 디렉토리 생성 버전별 독립 디렉토리다. 기존 디렉토리를 수정하지 않고 새로 만든다. ```sh NEW=0.30.0 OLD=0.29.0 cd manifests/helm/cloudnative-pg # 업스트림 차트를 신규 버전 디렉토리로 내려받는다 helm pull cnpg/cloudnative-pg --version "$NEW" --untar --untardir /tmp/cnpg-pull mkdir -p "$NEW" cp -R /tmp/cnpg-pull/cloudnative-pg/. "$NEW"/ # PaaSup 관리 파일을 이전 버전에서 승계한다 for f in custom-values.yaml dip-values.yaml dip-resources-quotas.yaml \ CUSTOM-README.md BUILD-README.md; do cp "$OLD/$f" "$NEW/$f" done ``` ### 3) diff 확인 업스트림 `values.yaml` 변경으로 `custom-values.yaml` 의 키가 사라졌는지 확인한다. 이게 Breaking Change 판단의 핵심이다. ```sh diff -u "$OLD/values.yaml" "$NEW/values.yaml" | less # custom-values.yaml 의 각 키가 신규 values.yaml 에 존재하는지 검증 helm template test "$NEW" -f "$NEW/custom-values.yaml" >/dev/null && echo "렌더링 OK" ``` `values.schema.json` 이 있으므로 없는 키를 넘기면 렌더링이 실패한다. 위 명령이 통과해야 한다. ### 4) 렌더링 결과 비교 ```sh helm template cnpg "$OLD" -f "$OLD/custom-values.yaml" -n cnpg-system > /tmp/old.yaml helm template cnpg "$NEW" -f "$NEW/custom-values.yaml" -n cnpg-system > /tmp/new.yaml diff -u /tmp/old.yaml /tmp/new.yaml ``` RBAC 규칙 추가/삭제, webhook 경로 변경, CRD 필드 변경을 특히 주의해서 본다. ## 3. 문서 갱신 | 파일 | 갱신 내용 | | --- | --- | | `CUSTOM-README.md` | 차트/operator 버전 번호, 업그레이드 명령의 CRD URL, 변경된 values 키 | | `BUILD-README.md` | 위 버전 대응 표에 신규 행 추가 | | `scripts/deploy-test/deploy-test-cnpg-cluster.sh` | 신규 버전으로 배포 검증 재실행 | | `manifests/helm/cnpg-cluster/*/CUSTOM-README.md` | operator 버전 호환성 명시 부분 | ## 4. 배포 검증 `scripts/deploy-test/deploy-test-cnpg-cluster.sh` 를 신규 버전으로 재실행한다 (절차: `.claude/deploy-test-procedure.md`). 최소한 다음 4개는 통과해야 한다. 1. operator Pod `Running`, CRD 11개 생성 2. `cnpg-cluster` 차트로 3-instance Cluster 배포 → `readyInstances=3/3` 3. `-rw` / `-ro` 서비스 라우팅 (primary / replica 분리) 4. primary Pod 삭제 → failover 후 쓰기 복구, 데이터 정합성 유지 ## 5. PR ```sh git add manifests/helm/cloudnative-pg/<신규버전> doc/ git commit -m "cloudnative-pg <신규버전> 추가" git push -u origin update-cloudnative-pg/<신규버전> ``` PR 생성 시 `helm-catalog-sbom` 워크플로가 변경 차트에 대해 SBOM·취약점 스캔을 수행한다. CRITICAL 취약점이 있으면 내용을 확인하고 PR 본문에 판단 근거를 남긴다.