feat(db): Migrate to CloudNativePG
This commit is contained in:
parent
54affa920e
commit
dc0ee8d343
31
manifests/grafana/database.yaml
Normal file
31
manifests/grafana/database.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: grafana-db
|
||||
namespace: monitoring
|
||||
|
||||
spec:
|
||||
instances: 1
|
||||
|
||||
storage:
|
||||
size: 2Gi
|
||||
storageClass: flat-storage-class
|
||||
|
||||
bootstrap:
|
||||
initdb:
|
||||
database: grafana
|
||||
owner: grafana
|
||||
secret:
|
||||
name: grafana-db
|
||||
|
||||
postgresql:
|
||||
pg_hba:
|
||||
- host all all all md5
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 500Mi
|
@ -61,6 +61,20 @@ spec:
|
||||
secretKeyRef:
|
||||
name: grafana-secrets
|
||||
key: admin-password
|
||||
- name: GF_DATABASE_TYPE
|
||||
value: postgres
|
||||
- name: GF_DATABASE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: grafana-db
|
||||
key: username
|
||||
- name: GF_DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: grafana-db
|
||||
key: password
|
||||
- name: GF_DATABASE_URL
|
||||
value: "postgres://$(GF_DATABASE_USER):$(GF_DATABASE_PASSWORD)@grafana-db-rw.monitoring.svc.cluster.local/grafana"
|
||||
volumes:
|
||||
- name: grafana-pv
|
||||
persistentVolumeClaim:
|
||||
|
@ -5,5 +5,6 @@ resources:
|
||||
- pvc.yaml
|
||||
- service.yaml
|
||||
- ingress.yaml
|
||||
- database.yaml
|
||||
- datasources.yaml
|
||||
- deployment.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user