From 6cee61707242a7dab97098e9c390b4f599aa74c6 Mon Sep 17 00:00:00 2001 From: Mayne0213 Date: Wed, 24 Dec 2025 00:01:57 +0900 Subject: [PATCH] FIX(db): use existing user and database - Created mas database in PostgreSQL - Changed from mas_user to bluemayne (existing user) - Use postgresql-password secret (root password) - Add CHAINLIT_DATABASE_URL for Chainlit compatibility - Improved error handling in chainlit_app.py --- deploy/k8s/base/deployment.yaml | 10 +++++++--- deploy/k8s/overlays/prod/kustomization.yaml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/deploy/k8s/base/deployment.yaml b/deploy/k8s/base/deployment.yaml index a6dc9f3..c72fc74 100644 --- a/deploy/k8s/base/deployment.yaml +++ b/deploy/k8s/base/deployment.yaml @@ -35,13 +35,17 @@ spec: key: groq-api-key - name: GROQ_API_BASE value: "https://api.groq.com/openai/v1" + # Chainlit uses asyncpg directly (not SQLAlchemy) + - name: CHAINLIT_DATABASE_URL + value: "postgresql://bluemayne:$(POSTGRES_PASSWORD)@postgresql-primary.postgresql.svc.cluster.local:5432/mas" + # SQLAlchemy format (if needed) - name: DATABASE_URL - value: "postgresql+asyncpg://mas_user:$(POSTGRES_PASSWORD)@postgresql.postgresql.svc.cluster.local:5432/mas" + value: "postgresql+asyncpg://bluemayne:$(POSTGRES_PASSWORD)@postgresql-primary.postgresql.svc.cluster.local:5432/mas" - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: - name: mas-postgres - key: password + name: postgresql-password + key: postgres-password - name: REDIS_URL value: "redis://redis:6379/0" resources: diff --git a/deploy/k8s/overlays/prod/kustomization.yaml b/deploy/k8s/overlays/prod/kustomization.yaml index 7fecc2d..857eb57 100644 --- a/deploy/k8s/overlays/prod/kustomization.yaml +++ b/deploy/k8s/overlays/prod/kustomization.yaml @@ -15,5 +15,5 @@ commonLabels: # 이미지 태그 설정 (ArgoCD Image Updater가 자동으로 업데이트) images: - name: gitea0213.kro.kr/bluemayne/mas - newTag: main-sha-cd21318a72d374d5a408fa60ba85704df5b262b5 + newTag: main-sha-9d051351250bca2b735c2200498297b1b578631c