feat: 声明 HWPOD host PostgreSQL 持久层

This commit is contained in:
pikastech
2026-07-21 02:50:31 +02:00
parent 406e50909f
commit 55a9bab82d
6 changed files with 118 additions and 6 deletions
+48
View File
@@ -161,6 +161,11 @@ postgres:
user: tasktree_production
address: 10.42.0.0/16
method: scram-sha-256
- type: hostssl
database: hwlab_nc01_v03
user: hwlab_nc01_v03_app
address: 10.42.0.0/16
method: scram-sha-256
- type: hostssl
database: hwlab_nc01_production
user: hwlab_nc01_production_app
@@ -299,6 +304,20 @@ secrets:
TASKTREE_PRODUCTION_DB_NAME: tasktree_production
randomHex:
TASKTREE_PRODUCTION_DB_PASSWORD: 32
- name: hwlab-nc01-v03-db-credentials
sourceRef: platform-db/hwlab-nc01-v03-db.env
type: env
requiredKeys:
- HWLAB_NC01_V03_DB_USER
- HWLAB_NC01_V03_DB_PASSWORD
- HWLAB_NC01_V03_DB_NAME
createIfMissing:
enabled: true
values:
HWLAB_NC01_V03_DB_USER: hwlab_nc01_v03_app
HWLAB_NC01_V03_DB_NAME: hwlab_nc01_v03
randomHex:
HWLAB_NC01_V03_DB_PASSWORD: 32
- name: hwlab-nc01-production-db-credentials
sourceRef: platform-db/hwlab-nc01-production-db.env
type: env
@@ -397,6 +416,15 @@ objects:
createdb: false
createrole: false
superuser: false
- name: hwlab_nc01_v03_app
passwordRef:
sourceRef: platform-db/hwlab-nc01-v03-db.env
key: HWLAB_NC01_V03_DB_PASSWORD
login: true
attributes:
createdb: false
createrole: false
superuser: false
- name: hwlab_nc01_production_app
passwordRef:
sourceRef: platform-db/hwlab-nc01-production-db.env
@@ -457,6 +485,11 @@ objects:
encoding: UTF8
locale: C.UTF-8
extensions: []
- name: hwlab_nc01_v03
owner: hwlab_nc01_v03_app
encoding: UTF8
locale: C.UTF-8
extensions: []
- name: hwlab_nc01_production
owner: hwlab_nc01_production_app
encoding: UTF8
@@ -592,6 +625,21 @@ exports:
- scope: hwlab-production
secret: hwlab-tasktree-db
key: DATABASE_URL
- name: hwlab-nc01-v03-cloud-api-database-url
sourceSecretRef: platform-db/hwlab-nc01-v03-db.env
render:
envKey: DATABASE_URL
format: postgresql://$(HWLAB_NC01_V03_DB_USER):$(HWLAB_NC01_V03_DB_PASSWORD)@$(PGHOST):5432/$(HWLAB_NC01_V03_DB_NAME)?sslmode=require
variables:
PGHOST: 10.42.0.1
writeToSecretSource:
sourceRef: hwlab/nc01-v03-cloud-api-db.env
key: DATABASE_URL
mode: update-or-insert
consumers:
- scope: hwlab-v03
secret: hwlab-cloud-api-v03-db
key: DATABASE_URL
- name: hwlab-nc01-production-cloud-api-database-url
sourceSecretRef: platform-db/hwlab-nc01-production-db.env
render: