Add postgres database for reports
This commit is contained in:
parent
4b13df8a56
commit
cad9ac8653
4
postgres/app/kustomization.yaml
Normal file
4
postgres/app/kustomization.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
namespace: reports-postgres
|
||||
resources:
|
||||
- ../base
|
||||
- namespace.yaml
|
||||
8
postgres/app/namespace.yaml
Normal file
8
postgres/app/namespace.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
labels:
|
||||
kubernetes.io/metadata.name: reports-postgres
|
||||
name: reports-postgres
|
||||
|
||||
64
postgres/base/database.yaml
Normal file
64
postgres/base/database.yaml
Normal file
@ -0,0 +1,64 @@
|
||||
apiVersion: kubegres.reactive-tech.io/v1
|
||||
kind: Kubegres
|
||||
metadata:
|
||||
name: report-db
|
||||
spec:
|
||||
|
||||
replicas: 2
|
||||
image: postgres:18
|
||||
|
||||
database:
|
||||
size: "30Gi"
|
||||
storageClassName: "standard"
|
||||
|
||||
backup:
|
||||
schedule: "0 */1 * * *"
|
||||
pvcName: report-db-backup
|
||||
volumeMount: /var/lib/backup
|
||||
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: report-db-credentials
|
||||
key: superUserPassword
|
||||
|
||||
- name: POSTGRES_REPLICATION_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: report-db-credentials
|
||||
key: replicationUserPassword
|
||||
scheduler:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- report-db
|
||||
topologyKey: kubernetes.io/hostname
|
||||
weight: 100
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: report-db-credentials
|
||||
type: Opaque
|
||||
stringData:
|
||||
superUserPassword: report-admin
|
||||
replicationUserPassword: report-replication
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: report-db-backup
|
||||
spec:
|
||||
storageClassName: "standard"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: "200Mi"
|
||||
2
postgres/base/kustomization.yaml
Normal file
2
postgres/base/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
resources:
|
||||
- database.yaml
|
||||
2
postgres/local/kustomization.yaml
Normal file
2
postgres/local/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
resources:
|
||||
- ../app
|
||||
Loading…
x
Reference in New Issue
Block a user