From 065a0b0953ef9d4fbec224655f6a2f0e5db48fef Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 25 Oct 2026 11:44:02 +0100 Subject: [PATCH] Provision Grafana PostgreSQL on CloudNativePG --- apps/grafana-postgresql/cluster/cluster.yaml | 17 +++++++++++++++++ .../cluster/kustomization.yaml | 4 ++++ bootstrap/grafana-postgresql.yaml | 3 +++ bootstrap/grafana-project.yaml | 2 ++ 4 files changed, 26 insertions(+) create mode 100644 apps/grafana-postgresql/cluster/cluster.yaml create mode 100644 apps/grafana-postgresql/cluster/kustomization.yaml diff --git a/apps/grafana-postgresql/cluster/cluster.yaml b/apps/grafana-postgresql/cluster/cluster.yaml new file mode 100644 index 0000000..3cadbf1 --- /dev/null +++ b/apps/grafana-postgresql/cluster/cluster.yaml @@ -0,0 +1,17 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: grafana-postgresql + namespace: grafana +spec: + instances: 1 + imageName: ghcr.io/cloudnative-pg/postgresql:17.11-standard-trixie + bootstrap: + initdb: + database: grafana + owner: grafana + secret: + name: grafana-postgresql-bootstrap + storage: + size: 5Gi + storageClass: rook-ceph-block diff --git a/apps/grafana-postgresql/cluster/kustomization.yaml b/apps/grafana-postgresql/cluster/kustomization.yaml new file mode 100644 index 0000000..993fbde --- /dev/null +++ b/apps/grafana-postgresql/cluster/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - cluster.yaml diff --git a/bootstrap/grafana-postgresql.yaml b/bootstrap/grafana-postgresql.yaml index af7f9ff..3c742e6 100644 --- a/bootstrap/grafana-postgresql.yaml +++ b/bootstrap/grafana-postgresql.yaml @@ -16,6 +16,9 @@ spec: - repoURL: https://code.brunner.ninja/feedc0de/homelab-gitops.git targetRevision: main ref: values + - repoURL: https://code.brunner.ninja/feedc0de/homelab-gitops.git + targetRevision: main + path: apps/grafana-postgresql/cluster destination: server: https://kubernetes.default.svc namespace: grafana diff --git a/bootstrap/grafana-project.yaml b/bootstrap/grafana-project.yaml index 0902dec..659cfc3 100644 --- a/bootstrap/grafana-project.yaml +++ b/bootstrap/grafana-project.yaml @@ -32,5 +32,7 @@ spec: kind: Deployment - group: apps kind: StatefulSet + - group: postgresql.cnpg.io + kind: Cluster - group: networking.k8s.io kind: Ingress