Provision Wiki.js PostgreSQL with CloudNativePG

This commit is contained in:
feedc0de committed 2026-10-25 12:42:32 +01:00
1 parent d3d02ae505
commit 6f4ab6f1c1
6 files changed
+85

No files matched your search

@@ -0,0 +1,40 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: wiki-js-cnpg
namespace: wiki-js
spec:
instances: 1
enableSuperuserAccess: true
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- odroid-h3-00
- odroid-h3-01
- odroid-h3-02
- odroid-h3-03
- odroid-h3-04
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- odroid-h3-00
- odroid-h3-03
imageName: ghcr.io/cloudnative-pg/postgresql:17.11-standard-trixie
bootstrap:
initdb:
database: wikijs
owner: wikijs
secret:
name: wiki-js-cnpg-bootstrap
storage:
size: 5Gi
storageClass: rook-ceph-block
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cluster.yaml
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- service.yaml
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: postgresql
namespace: wiki-js
spec:
ports:
- name: postgresql
port: 5432
protocol: TCP
targetPort: 5432
selector:
cnpg.io/cluster: wiki-js-cnpg
cnpg.io/instanceRole: primary
type: ClusterIP
+1
View File
@@ -89,6 +89,7 @@ resources:
- visual-studio-code.yaml
- wiki-js.yaml
- wiki-js-postgresql.yaml
- wiki-js-cnpg.yaml
- homeassistant-postgresql.yaml
- home-assistant.yaml
- media-project.yaml
+21
View File
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: wiki-js-cnpg
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "0"
spec:
project: homelab
source:
repoURL: https://code.brunner.ninja/feedc0de/homelab-gitops.git
targetRevision: main
path: apps/wiki-js-postgresql/cluster
destination:
server: https://kubernetes.default.svc
namespace: wiki-js
syncPolicy:
automated:
enabled: true
prune: true
selfHeal: true