카탈로그 앱 내장 bitnami postgresql → cnpg-cluster 전환 (1차 5개 차트)

이슈 #9에서 결정된 CloudNativePG 채택을 카탈로그 앱에 확장 적용한다.
airflow/lakekeeper/mlflow/superset/flowise 5개 차트가 내장하던 bitnami
postgresql 서브차트를 끄고 앱 전용 cnpg-cluster 인스턴스를 외부 DB로 쓰도록
전환했다. 5개 모두 dev 클러스터 격리 네임스페이스에서 배포 테스트로 실측 검증했다.

gitea/keycloak/dnsup 는 서브차트가 아니라 공유 postgresql-ha 를 외부 참조하며
paasup/dipup 레포 관리 대상이라 제외했다 — 인수인계 문서만 추가했다.

배포 구조:
- ArgoCD ApplicationSet 으로 DB(syncWave 0) → 앱(syncWave 1) 순서를 보장한다.
  기존 openmetadata/victoria-metrics 관례를 따랐다. cnpg-cluster 차트는 범용
  상태로 유지하고 앱별 값은 manifests/applicationset/<app>/ 에 둔다.

검증 중 발견해 함께 고친 문제:
- lakekeeper: cnpg 의 -ro 는 replica 전용이라 instances:1 에서 엔드포인트가
  0개다. 읽기 연결을 -r(전체 라운드로빈)로 교체했다.
- airflow/superset: ingressClassName 누락 + kong 애노테이션 잔존으로 이
  클러스터(apisix 전용)에서 ingress 접근이 아예 불가능했다. apisix + regex
  path 로 교체했다.
- 배포 테스트가 PV 만 지우고 Longhorn Volume CR 을 남겨 storageScheduled 가
  누적됐다(orphan 112개 ~1TB 로 배포 차단). 두 스크립트의 정리 로직을 고쳤다.

재사용 구조화:
- .claude/skills/chart-to-cnpg/ 신규. 남은 4개 차트(langflow-ide, langfuse,
  litellm, nemo)에 같은 절차를 재사용한다. flowise 에 실제 적용해 검증했다.
- 배포 테스트 공통 절차는 .claude/deploy-test-procedure.md, 환경 함정은
  .claude/pitfalls.md 로 단일화하고 앱별 README 는 참조만 남겼다.

관련: #9, #14

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
wbsong111
2026-08-05 15:17:46 +09:00
parent 35ce2bb80d
commit 3ee1c1ee23
42 changed files with 1650 additions and 146 deletions
+34 -11
View File
@@ -122,17 +122,40 @@ logs:
### 4) Postgresql 설정
- 내장 postgresql을 사용하여 배포할 수 있다.
- 내장 bitnami postgresql 서브차트 대신, `cnpg-cluster`(전용 인스턴스)를 외부 DB로 사용한다.
- **사전 조건**: `cloudnative-pg` operator(`manifests/helm/cloudnative-pg/0.29.0`)가 클러스터에
먼저 설치되어 있어야 한다.
- **배포 순서**
``` sh
# 1) airflow용 DB 계정 시크릿 생성 (아래 password는 metadataConnection.pass와 동일해야 한다)
kubectl create secret generic airflow-db-app-secret \
--from-literal=username=airflow --from-literal=password=airflow -n airflow
# 2) 전용 cnpg-cluster 배포
helm upgrade airflow-db manifests/helm/cnpg-cluster/1.0.0 \
-f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
-f manifests/applicationset/airflow/1.16.0/airflow-db-values.yaml \
--install -n airflow
# 3) airflow 배포 (기존 배포 방법과 동일)
helm upgrade airflow ./ -f custom-values.yaml --install -n airflow --create-namespace
```
- ArgoCD로 배포한다면 `manifests/applicationset/airflow/1.16.0/`의 ApplicationSet을 쓴다 —
`airflow-db`(syncWave 0) → `airflow`(syncWave 1) 순서로 자동 배포된다. 자세한 내용은
해당 디렉토리의 `README.md` 참고.
- custom-values.yaml
``` yaml
postgresql:
enabled: true
auth:
enablePostgresUser: true
postgresPassword: postgres # postgres 유저의 패스워드 설정
primary:
persistence:
enabled: true
size: 8Gi # airflow에서 사용하는 DB의 볼륨 사이즈 설정
storageClass: "" # DB 볼륨 배포를 위한 storage class 설정
```
enabled: false
data:
metadataConnection:
user: airflow
pass: airflow # 위 시크릿 생성 시 사용한 password와 동일해야 한다
protocol: postgresql
host: airflow-db-rw # cnpg-cluster 릴리스명이 airflow-db일 때의 rw 서비스명
port: 5432
db: airflow
sslmode: disable
```
- 참고: `manifests/applicationset/airflow/1.16.0/airflow-db-values.yaml`
@@ -4,11 +4,17 @@
ingress:
web:
enabled: true
# Kong → APISIX 마이그레이션(issue #139, mlflow/lakekeeper와 동일). 이 클러스터에는
# kong ingress controller가 없어 `kubernetes.io/ingress.class: kong` 애노테이션 방식은
# 어떤 컨트롤러도 인식하지 않아 접근 자체가 불가능했다(실측 — CLASS: <none>).
ingressClassName: "apisix"
# 기본 path "/" 는 정확히 "/" 만 매치되어(exact) airflow가 "/home" 등으로 리다이렉트한
# 뒤에는 전부 404가 난다(실측). lakekeeper와 동일하게 regex 전체 매치로 바꾼다.
path: "/.*"
annotations:
cert-manager.io/issuer: "root-ca-issuer"
kubernetes.io/ingress.class: kong
konghq.com/protocols: https
konghq.com/https-redirect-status-code: "301"
cert-manager.io/cluster-issuer: "root-ca-issuer"
k8s.apisix.apache.org/ssl-redirect: "true"
k8s.apisix.apache.org/use-regex: "true"
hosts:
- name: "airflow.example.org"
tls:
@@ -81,13 +87,19 @@ logs:
statsd:
enabled: false
# 내장 bitnami postgresql 서브차트 대신 cnpg-cluster(전용 인스턴스)를 외부 DB로 사용한다.
# 사전 배포: helm install airflow-db manifests/helm/cnpg-cluster/1.0.0 \
# -f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
# -f manifests/applicationset/airflow/1.16.0/airflow-db-values.yaml -n <ns>
postgresql:
enabled: true
auth:
enablePostgresUser: true
postgresPassword: postgres
primary:
persistence:
enabled: true
size: 8Gi # airflow에서 사용하는 DB의 볼륨 사이즈 설정
storageClass: ""
enabled: false
data:
metadataConnection:
user: airflow
pass: airflow
protocol: postgresql
host: airflow-db-rw
port: 5432
db: airflow
sslmode: disable
@@ -34,13 +34,21 @@ ingress:
- flowise.example.org
secretName: flowise-tls-secret
# 내장 bitnami postgresql 서브차트 대신 cnpg-cluster(전용 인스턴스)를 외부 DB로 사용한다.
# 사전 배포: helm install flowise-db manifests/helm/cnpg-cluster/1.0.0 \
# -f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
# -f manifests/applicationset/flowise/6.0.0/flowise-db-values.yaml -n <ns>
postgresql:
enabled: false
externalPostgresql:
enabled: true
primary:
persistence:
enabled: true
size: 8Gi
host: flowise-db-rw # cnpg-cluster 릴리스명이 flowise-db일 때의 rw 서비스명
port: 5432
username: flowise
password: flowise # cnpg-cluster 부트스트랩 시크릿의 password와 동일해야 한다
database: flowise
redis:
enabled: true
@@ -68,12 +68,20 @@ catalog:
secret:
secretName: root-ca-secret
# lakekeeper DB
# lakekeeper DB — 내장 postgres 서브차트 대신 cnpg-cluster(전용 인스턴스)를 외부 DB로 사용한다.
postgresql:
storage:
className:
requestedSize: 5Gi
resources: {}
enabled: false
externalDatabase:
type: postgres
# -ro는 replica 전용이라 instances:1(권장 기준, small 티어)에서는 엔드포인트가 없다 —
# -r(전체 인스턴스 라운드로빈, primary 포함)을 대신 쓴다. 배포 테스트로 실측된 문제다.
host_read: "lakekeeper-db-r"
host_write: "lakekeeper-db-rw"
port: 5432
database: lakekeeper
user: lakekeeper
password: lakekeeper
# OIDC 인증
auth:
@@ -162,11 +170,35 @@ extraVolumes:
### 4) PostgreSQL 데이터베이스 설정
- 내장 postgres 서브차트(`groundhog2k/postgres`) 대신 `cnpg-cluster`(전용 인스턴스)를 외부 DB로
사용한다. **사전 조건**: `cloudnative-pg` operator가 클러스터에 먼저 설치되어 있어야 한다.
- **배포 순서**
``` sh
kubectl create secret generic lakekeeper-db-app-secret \
--from-literal=username=lakekeeper --from-literal=password=lakekeeper -n lakekeeper
helm upgrade lakekeeper-db manifests/helm/cnpg-cluster/1.0.0 \
-f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
-f manifests/applicationset/lakekeeper/0.11.0/lakekeeper-db-values.yaml \
--install -n lakekeeper
helm upgrade lakekeeper ./ -f custom-values.yaml --install -n lakekeeper --create-namespace
```
- ArgoCD로 배포한다면 `manifests/applicationset/lakekeeper/0.11.0/`의 ApplicationSet을 쓴다 —
`lakekeeper-db`(syncWave 0) → `lakekeeper`(syncWave 1) 순서로 자동 배포된다. 자세한 내용은
해당 디렉토리의 `README.md` 참고.
| Name | 설명 | 기본값 |
| ------------------------- | ------------------------------------------------------------ | ----------- |
| `postgresql.storage.className` | 스토리지 클래스 | `""` |
| `postgresql.storage.requestedSize` | PostgreSQL 스토리지 크기 | `5Gi` |
| `postgresql.resources` | PostgreSQL 리소스 설정 | `{}` |
| `postgresql.enabled` | 내장 postgres 서브차트 사용 여부. cnpg-cluster 사용 시 `false` | `false` |
| `externalDatabase.host_write` | cnpg-cluster의 rw 서비스명(`<release>-rw`) | `lakekeeper-db-rw` |
| `externalDatabase.host_read` | cnpg-cluster의 ro 서비스명(`<release>-ro`) | `lakekeeper-db-ro` |
| `externalDatabase.database`, `.user`, `.password` | DB 계정 정보. cnpg-cluster 부트스트랩 시크릿과 동일해야 한다 | 참고 예시 |
> 참고: `manifests/applicationset/lakekeeper/0.11.0/lakekeeper-db-values.yaml`
>
> OpenFGA 인증/권한 스토어(`internalOpenFGA: true`)는 여전히 자체 bitnami postgresql
> 서브차트(`openfga.postgresql`)를 내장 사용한다 — 이번 전환 범위에는 포함되지 않았다.
### 5) OIDC 인증 설정
@@ -29,13 +29,27 @@ catalog:
secret:
secretName: root-ca-secret
# lakekeeper DB
# lakekeeper DB — 내장 postgres 서브차트(groundhog2k/postgres) 대신
# cnpg-cluster(전용 인스턴스)를 외부 DB로 사용한다.
# 사전 배포: helm install lakekeeper-db manifests/helm/cnpg-cluster/1.0.0 \
# -f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
# -f manifests/applicationset/lakekeeper/0.11.0/lakekeeper-db-values.yaml -n <ns>
postgresql:
enabled: true
storage:
className:
requestedSize: 5Gi
resources: {}
enabled: false
externalDatabase:
type: postgres
# cnpg-cluster의 -ro 서비스는 replica 파드에만 연결되는데, 권장 배포 기준인
# instances: 1(small 티어)에서는 replica가 없어 -ro가 엔드포인트 0개인 서비스가
# 된다 — lakekeeper의 read-connection이 영구히 재시도만 하며 멈춘다(배포 테스트로 실측).
# -r은 인스턴스 수와 무관하게 항상 primary를 포함해 라운드로빈하므로 이 값을 쓴다.
# instances를 3 이상으로 올려 실제 replica를 운용하는 경우에도 -r로 충분하다.
host_read: "lakekeeper-db-r"
host_write: "lakekeeper-db-rw"
port: 5432
database: lakekeeper
user: lakekeeper
password: lakekeeper
# OIDC 인증
@@ -0,0 +1,85 @@
# MLflow 배포
bitnami/mlflow 차트(2.1.0) 기반 배포 가이드다.
## 1. 배포 방법
### 1) 사전 조건
- 내장 bitnami postgresql 서브차트 대신 `cnpg-cluster`(전용 인스턴스)를 외부 DB로 사용한다.
`cloudnative-pg` operator(`manifests/helm/cloudnative-pg/0.29.0`)가 클러스터에 먼저 설치되어
있어야 한다.
### 2) 배포 순서
```sh
git clone https://github.com/paasup/dip-catalog.git
cd dip-catalog
# 1) mlflow용 DB 계정 시크릿 생성 (password는 externalDatabase.password와 동일해야 한다)
kubectl create secret generic mlflow-db-app-secret \
--from-literal=username=mlflow --from-literal=password=mlflow1234 -n mlflow
# 2) 전용 cnpg-cluster 배포
helm upgrade mlflow-db manifests/helm/cnpg-cluster/1.0.0 \
-f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
-f manifests/applicationset/mlflow/2.1.0/mlflow-db-values.yaml \
--install -n mlflow --create-namespace
# 3) mlflow 배포
helm upgrade mlflow manifests/helm/mlflow/2.1.0 -f custom-values.yaml --install -n mlflow
```
ArgoCD로 배포한다면 `manifests/applicationset/mlflow/2.1.0/`의 ApplicationSet을 쓴다 —
`mlflow-db`(syncWave 0) → `mlflow`(syncWave 1) 순서로 자동 배포된다. 자세한 내용은 해당
디렉토리의 `README.md` 참고.
## 2. custom-values.yaml 설명
### 1) 이미지 설정
private 환경 배포 시 registry를 변경한다.
```yaml
image:
repository: bitnamilegacy/mlflow
gitImage:
repository: bitnamilegacy/git
waitContainer:
image:
repository: bitnamilegacy/os-shell
```
### 2) PostgreSQL 설정
내장 postgresql 서브차트를 끄고 `externalDatabase`로 cnpg-cluster를 가리킨다.
```yaml
postgresql:
enabled: false
externalDatabase:
dialectDriver: "postgresql"
host: "mlflow-db-rw" # cnpg-cluster 릴리스명이 mlflow-db일 때의 rw 서비스명
port: 5432
user: mlflow
password: mlflow1234 # 위 시크릿 생성 시 사용한 password와 동일해야 한다
database: mlflow
```
참고: `manifests/applicationset/mlflow/2.1.0/mlflow-db-values.yaml`
### 3) MinIO 설정
아티팩트 저장소로 내장 minio 서브차트를 사용한다(`minio.enabled: true`). private 환경에서는
`minio.image.repository`를 내부 registry로 변경한다.
```yaml
minio:
enabled: true
auth:
rootUser: admin
rootPassword: admin1234
image:
repository: bitnamilegacy/minio
```
+13 -13
View File
@@ -45,20 +45,20 @@ run:
cpu: 250m
memory: 512Mi
# 내장 bitnami postgresql 서브차트 대신 cnpg-cluster(전용 인스턴스)를 외부 DB로 사용한다.
# 사전 배포: helm install mlflow-db manifests/helm/cnpg-cluster/1.0.0 \
# -f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
# -f manifests/applicationset/mlflow/2.1.0/mlflow-db-values.yaml -n <ns>
postgresql:
auth:
username: mlflow
password: mlflow1234
image:
repository: bitnamilegacy/postgresql
primary:
reousrces:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 250m
memory: 512Mi
enabled: false
externalDatabase:
dialectDriver: "postgresql"
host: "mlflow-db-rw"
port: 5432
user: mlflow
password: mlflow1234
database: mlflow
minio:
enabled: true
auth:
+31 -27
View File
@@ -247,34 +247,38 @@ bootstrapScript: |
### 6) postgresql
- subchart로 포함된 postgresql을 배포하기 위한 설정이다.
- 내장 bitnami postgresql 서브차트 대신 `cnpg-cluster`(전용 인스턴스)를 외부 DB로 사용한다.
- **사전 조건**: `cloudnative-pg` operator가 클러스터에 먼저 설치되어 있어야 한다.
- **배포 순서**
``` sh
kubectl create secret generic superset-db-app-secret \
--from-literal=username=superset --from-literal=password=superset -n superset
``` yaml
postgresql:
enabled: true
auth:
# DB의 계정 및 기본 생성되는 database를 설정한다.
username: superset
password: superset
database: superset
image:
# private 환경에서 배포할 때 사용할 registry로 설정을 변경한다.
registry: docker.io
primary:
# DB의 리소스를 설정한다.
resources:
limits: {}
requests:
memory: 256Mi
cpu: 250m
# DB에서 사용할 Disk 설정으로 StorageClass와 사이즈를 설정한다.
persistence:
enabled: true
storageClass: ""
accessModes:
- ReadWriteOnce
size: 8Gi
```
helm upgrade superset-db manifests/helm/cnpg-cluster/1.0.0 \
-f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
-f manifests/applicationset/superset/0.13.5/superset-db-values.yaml \
--install -n superset
helm upgrade superset ../superset --install -n superset --create-namespace \
-f ./custom-values.yaml
```
- ArgoCD로 배포한다면 `manifests/applicationset/superset/0.13.5/`의 ApplicationSet을 쓴다 —
`superset-db`(syncWave 0) → `superset`(syncWave 1) 순서로 자동 배포된다. 자세한 내용은
해당 디렉토리의 `README.md` 참고.
- custom-values.yaml
``` yaml
postgresql:
enabled: false
supersetNode:
connections:
db_host: 'superset-db-rw' # cnpg-cluster 릴리스명이 superset-db일 때의 rw 서비스명
db_port: "5432"
db_user: superset
db_pass: superset # 위 시크릿 생성 시 사용한 password와 동일해야 한다
db_name: superset
```
- 참고: `manifests/applicationset/superset/0.13.5/superset-db-values.yaml`
@@ -99,11 +99,17 @@ tolerations: []
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: "selfsigned-issuer"
cert-manager.io/duration: 8760h
# airflow와 동일하게 실측된 문제 — ingressClassName 미지정 시 이 클러스터의 apisix가
# 아예 인식하지 않아 CLASS: <none>으로 뜨고 접근이 불가능하다. path도 exact "/" 만
# 매치되면 superset의 내부 리다이렉트(예: /login/) 이후 전부 404가 나 regex로 바꾼다.
ingressClassName: "apisix"
annotations:
cert-manager.io/cluster-issuer: "selfsigned-issuer"
cert-manager.io/duration: 8760h
cert-manager.io/renew-before: 720h
path: /
k8s.apisix.apache.org/use-regex: "true"
k8s.apisix.apache.org/ssl-redirect: "true"
path: /.*
pathType: ImplementationSpecific
hosts:
- superset.example.org
@@ -133,8 +139,11 @@ supersetNode:
redis_ssl:
enabled: false
ssl_cert_reqs: CERT_NONE
# You need to change below configuration incase bringing own PostgresSQL instance and also set postgresql.enabled:false
db_host: '{{ .Release.Name }}-postgresql'
# 내장 bitnami postgresql 서브차트 대신 cnpg-cluster(전용 인스턴스)를 외부 DB로 사용한다.
# 사전 배포: helm install superset-db manifests/helm/cnpg-cluster/1.0.0 \
# -f manifests/helm/cnpg-cluster/1.0.0/custom-values.yaml \
# -f manifests/applicationset/superset/0.13.5/superset-db-values.yaml -n <ns>
db_host: 'superset-db-rw'
db_port: "5432"
db_user: superset
db_pass: superset
@@ -160,23 +169,7 @@ supersetCeleryFlower:
resources: {}
postgresql:
enabled: true
auth:
username: superset
password: superset
database: superset
image:
registry: docker.io
primary:
resources:
limits: {}
requests:
memory: 256Mi
cpu: 250m
persistence:
enabled: true
storageClass: ""
size: 8Gi
enabled: false
redis:
enabled: true