feat(customer1): add trading_dashboard database to siriusdevops-pgdb CNPG cluster
- Add trading_dashboard role + Database CR on siriusdevops-pgdb - Create SOPS-encrypted credentials secret (template) - Update trade-dashboard to use the new dedicated DB - New host: siriusdevops-pgdb-rw - New database: trading_dashboard - New credentials secret
This commit is contained in:
parent
da8fe22f6e
commit
57e41178c3
6 changed files with 48 additions and 5 deletions
|
|
@ -6,3 +6,6 @@ resources:
|
|||
- waitlist-db-credentials.yaml
|
||||
- waitlist-db.yaml
|
||||
- siriusdevops-scheduled-backup.yaml
|
||||
# New trading dashboard DB
|
||||
- trading-dashboard-db-credentials.yaml
|
||||
- trading-dashboard-db.yaml
|
||||
|
|
|
|||
|
|
@ -17,6 +17,12 @@ spec:
|
|||
login: true
|
||||
passwordSecret:
|
||||
name: waitlist-db-credentials
|
||||
# NEW - Trading Dashboard role
|
||||
- name: trading_dashboard
|
||||
ensure: present
|
||||
login: true
|
||||
passwordSecret:
|
||||
name: trading-dashboard-db-credentials
|
||||
|
||||
bootstrap:
|
||||
initdb:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: trading-dashboard-db-credentials
|
||||
namespace: customer1
|
||||
type: Opaque
|
||||
stringData:
|
||||
username: trading_dashboard
|
||||
password: CHANGE_ME_TO_STRONG_PASSWORD
|
||||
sops:
|
||||
# Run `sops -e -i trading-dashboard-db-credentials.yaml` after filling in the password
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age: []
|
||||
lastmodified: ""
|
||||
mac: ""
|
||||
encrypted_regex: ^(data|stringData)$
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Database
|
||||
metadata:
|
||||
name: trading-dashboard-db
|
||||
namespace: customer1
|
||||
spec:
|
||||
cluster:
|
||||
name: siriusdevops-pgdb
|
||||
name: trading_dashboard
|
||||
owner: trading_dashboard
|
||||
|
|
@ -4,7 +4,6 @@ metadata:
|
|||
name: trade-dashboard-config
|
||||
namespace: customer1
|
||||
data:
|
||||
DB_USER: "trading"
|
||||
DB_HOST: "hermes-pgdb-rw.customer1.svc.cluster.local"
|
||||
DB_HOST: "siriusdevops-pgdb-rw.customer1.svc.cluster.local"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "trading_data"
|
||||
DB_NAME: "trading_dashboard"
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ spec:
|
|||
- name: DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: trading-db-credentials
|
||||
name: trading-dashboard-db-credentials
|
||||
key: username
|
||||
- name: DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: trading-db-credentials
|
||||
name: trading-dashboard-db-credentials
|
||||
key: password
|
||||
startupProbe:
|
||||
httpGet:
|
||||
|
|
@ -61,3 +61,9 @@ spec:
|
|||
port: 8000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue