자체 빌드 이미지 3종(cloudnative-pg/cnpg-postgresql/etcd) + 대응 헬름 차트 도입

security-catalog 프로젝트에서 첫 실사용 자체 빌드 이미지 3종을 포팅한다 — 전부
상위 태그·베이스 OS 교체로 해소 안 되는 CVE(Go 모듈 정적 링크 또는 미수정 CRITICAL/
HIGH)를 자체 빌드(소스 컴파일 또는 SUSE BCI 재설치)로 대응한다:

- images/cloudnative-pg: CNPG operator, release-1.30 소스 컴파일 + bci-micro
- images/cnpg-postgresql: PostgreSQL 18.4, bci-base + zypper 재설치
- images/etcd: etcd v3.7.1, 소스 컴파일(x/text 강제 업그레이드) + bci-micro

함께 추가:
- manifests/helm/{cloudnative-pg,cnpg-cluster,etcd} — 위 이미지를 참조하는 카탈로그 차트
- scripts/deploy-test/*.sh, .claude/deploy-test-procedure.md — CVE 0건과 별개로
  "실제로 뜨는가"를 검증하는 배포 스모크 테스트
- .claude/pitfalls.md — 자체 빌드/배포 테스트 중 실측한 함정 모음

검토 중 발견해 반영한 수정:
- cloudnative-pg 차트의 image 블록을 etcd와 동일한 registry/repository/tag 3필드+
  따옴표 포맷으로 통일 — 기존 포맷(repository에 registry+repo 결합, 따옴표 없음)은
  patch-catalog-tag.py 의 split 패처가 tag만 갱신하고 repository는 그대로 남기는
  조용한 부분 치환을 일으켜, 향후 레지스트리 마이그레이션 시 깨진 참조를 만들 수 있었다
- cnpg-cluster 차트의 SLES 커버리지 코멘트를 최신 실측(trivy가 SLES 15.7을 정상
  커버함, 2026-07-29 재측정)에 맞게 정정 — 폐기된 "측정 불가/OVAL 우회 필요" 결론이
  남아있었다
- CLAUDE.md/MEMORY.md 의 "images/ 디렉토리 없음" 서술을 갱신하고, 레지스트리
  마이그레이션(docker.io/wbsong111 → docker.io/paasup)·decisions/analysis 문서 이관·
  리소스 프로파일 추가를 다음 작업으로 기록

이 3개 이미지는 아직 dip-catalog 자체 CI(build-image.yml)로 빌드·게이트·push 를
실행해본 적이 없다 — 현재 참조 태그는 security-catalog 쪽에서 이미 검증된 것이다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
wbsong111
2026-08-03 12:03:37 +09:00
parent a168a3c7e6
commit 6878b61efa
89 changed files with 36608 additions and 11 deletions
@@ -0,0 +1,102 @@
# 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` | 위 버전 대응 표에 신규 행 추가 |
| `doc/charts/cnpg/deploy-test.md` | 신규 버전으로 배포 테스트 재실행 후 결과 갱신 |
| `manifests/helm/cnpg-cluster/*/CUSTOM-README.md` | operator 버전 호환성 명시 부분 |
## 4. 배포 검증
`doc/charts/cnpg/deploy-test.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 본문에 판단 근거를 남긴다.