diff --git a/apps/homeassistant-postgresql/cluster/cluster.yaml b/apps/homeassistant-postgresql/cluster/cluster.yaml new file mode 100644 index 0000000..1f34415 --- /dev/null +++ b/apps/homeassistant-postgresql/cluster/cluster.yaml @@ -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 diff --git a/apps/homeassistant-postgresql/cluster/kustomization.yaml b/apps/homeassistant-postgresql/cluster/kustomization.yaml new file mode 100644 index 0000000..993fbde --- /dev/null +++ b/apps/homeassistant-postgresql/cluster/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - cluster.yaml diff --git a/apps/homeassistant-postgresql/values.yaml b/apps/homeassistant-postgresql/values.yaml deleted file mode 100644 index 927e909..0000000 --- a/apps/homeassistant-postgresql/values.yaml +++ /dev/null @@ -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 diff --git a/bootstrap/homeassistant-postgresql-project.yaml b/bootstrap/homeassistant-postgresql-project.yaml index 028b82f..6e21953 100644 --- a/bootstrap/homeassistant-postgresql-project.yaml +++ b/bootstrap/homeassistant-postgresql-project.yaml @@ -22,3 +22,5 @@ spec: kind: ServiceAccount - group: apps kind: StatefulSet + - group: postgresql.cnpg.io + kind: Cluster diff --git a/bootstrap/homeassistant-postgresql.yaml b/bootstrap/homeassistant-postgresql.yaml index c36899f..e869835 100644 --- a/bootstrap/homeassistant-postgresql.yaml +++ b/bootstrap/homeassistant-postgresql.yaml @@ -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