Provision Home Assistant PostgreSQL on CloudNativePG

This commit is contained in:
feedc0de committed 2026-10-25 12:12:24 +01:00
1 parent 9c24c2f946
commit e089e75a99
5 files changed
+27 -38

No files matched your search

@@ -0,0 +1,17 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: homeassistant-cnpg
namespace: homeassistant
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:17.11-standard-trixie
bootstrap:
initdb:
database: homeassistant
owner: homeassistant
secret:
name: homeassistant-cnpg-bootstrap
storage:
size: 30Gi
storageClass: rook-ceph-block
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster.yaml
-27
View File
@@ -1,27 +0,0 @@
settings:
existingSecret: homeassistant-postgresql
superuser:
secretKey: POSTGRES_USER
superuserPassword:
secretKey: POSTGRES_PASSWORD
userDatabase:
existingSecret: homeassistant-postgresql
name:
secretKey: USERDB_NAME
user:
secretKey: USERDB_USER
password:
secretKey: USERDB_PASSWORD
storage:
requestedSize: 30Gi
className: rook-ceph-block
persistentVolumeClaimRetentionPolicy:
whenDeleted: Retain
whenScaled: Retain
resources:
requests:
cpu: 100m
memory: 512Mi
@@ -22,3 +22,5 @@ spec:
kind: ServiceAccount
- group: apps
kind: StatefulSet
- group: postgresql.cnpg.io
kind: Cluster
+4 -11
View File
@@ -5,24 +5,17 @@ metadata:
namespace: argocd
spec:
project: homeassistant-postgresql
sources:
- repoURL: https://groundhog2k.github.io/helm-charts/
chart: postgres
targetRevision: 1.5.14
helm:
releaseName: postgresql
valueFiles:
- $values/apps/homeassistant-postgresql/values.yaml
- repoURL: https://code.brunner.ninja/feedc0de/homelab-gitops.git
source:
repoURL: https://code.brunner.ninja/feedc0de/homelab-gitops.git
targetRevision: main
ref: values
path: apps/homeassistant-postgresql/cluster
destination:
server: https://kubernetes.default.svc
namespace: homeassistant
syncPolicy:
automated:
enabled: true
prune: false
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true