# PostgreSQL 아키텍처 설정
architecture: standalone

# 글로벌 설정
global:
  postgresql:
    auth:
      postgresPassword: "Hi5Jessica!"
      replicationPassword: "Hi5Jessica!" 
      database: "participationdb"
      username: "eventuser"
      password: "Hi5Jessica!"
  storageClass: "managed-premium"
  
# Primary 설정
primary:
  persistence:
    enabled: true
    storageClass: "managed-premium"
    size: 10Gi
  
  resources:
    limits:
      memory: "4Gi"
      cpu: "1"
    requests:
      memory: "2Gi"
      cpu: "0.5"
  
  # 성능 최적화 설정  
  extraEnvVars:
    - name: POSTGRESQL_SHARED_BUFFERS
      value: "1GB"
    - name: POSTGRESQL_EFFECTIVE_CACHE_SIZE  
      value: "3GB"
    - name: POSTGRESQL_MAX_CONNECTIONS
      value: "200"
    - name: POSTGRESQL_WORK_MEM
      value: "16MB"
    - name: POSTGRESQL_MAINTENANCE_WORK_MEM
      value: "256MB"

  # 고가용성 설정
  podAntiAffinityPreset: soft

# 네트워크 설정
service:
  type: ClusterIP
  ports:
    postgresql: 5432

# 보안 설정
securityContext:
  enabled: true
  fsGroup: 1001
  runAsUser: 1001

# image: organization이 bitnami -> bitnamilegacy로 변경
image:
  registry: docker.io
  repository: bitnamilegacy/postgresql
