diff --git a/apps/ombi-postgresql/cluster/cluster.yaml b/apps/ombi-postgresql/cluster/cluster.yaml new file mode 100644 index 0000000..b963025 --- /dev/null +++ b/apps/ombi-postgresql/cluster/cluster.yaml @@ -0,0 +1,18 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: ombi-cnpg + namespace: ombi +spec: + instances: 1 + enableSuperuserAccess: true + imageName: ghcr.io/cloudnative-pg/postgresql:17.11-standard-trixie + bootstrap: + initdb: + database: ombi + owner: ombi + secret: + name: ombi-cnpg-bootstrap + storage: + size: 5Gi + storageClass: rook-ceph-block diff --git a/apps/ombi-postgresql/cluster/kustomization.yaml b/apps/ombi-postgresql/cluster/kustomization.yaml new file mode 100644 index 0000000..993fbde --- /dev/null +++ b/apps/ombi-postgresql/cluster/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - cluster.yaml diff --git a/apps/ombi-postgresql/cluster/service.yaml b/apps/ombi-postgresql/cluster/service.yaml new file mode 100644 index 0000000..865f156 --- /dev/null +++ b/apps/ombi-postgresql/cluster/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: postgresql + namespace: ombi +spec: + ports: + - name: postgresql + port: 5432 + protocol: TCP + targetPort: 5432 + selector: + cnpg.io/cluster: ombi-cnpg + cnpg.io/instanceRole: primary + type: ClusterIP diff --git a/apps/ombi-postgresql/service/kustomization.yaml b/apps/ombi-postgresql/service/kustomization.yaml new file mode 100644 index 0000000..9bb4d07 --- /dev/null +++ b/apps/ombi-postgresql/service/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - service.yaml diff --git a/apps/ombi-postgresql/service/service.yaml b/apps/ombi-postgresql/service/service.yaml new file mode 100644 index 0000000..865f156 --- /dev/null +++ b/apps/ombi-postgresql/service/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: postgresql + namespace: ombi +spec: + ports: + - name: postgresql + port: 5432 + protocol: TCP + targetPort: 5432 + selector: + cnpg.io/cluster: ombi-cnpg + cnpg.io/instanceRole: primary + type: ClusterIP diff --git a/bootstrap/kustomization.yaml b/bootstrap/kustomization.yaml index d30c849..55fed5f 100644 --- a/bootstrap/kustomization.yaml +++ b/bootstrap/kustomization.yaml @@ -77,6 +77,7 @@ resources: - ombi-namespace.yaml - ombi-postgresql-secret.yaml - ombi-postgresql.yaml +- ombi-cnpg.yaml - tautulli.yaml - uptime-kuma.yaml - grafana.yaml diff --git a/bootstrap/ombi-cnpg.yaml b/bootstrap/ombi-cnpg.yaml new file mode 100644 index 0000000..1ca728e --- /dev/null +++ b/bootstrap/ombi-cnpg.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: ombi-cnpg + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "0" +spec: + project: ombi + source: + repoURL: https://code.brunner.ninja/feedc0de/homelab-gitops.git + targetRevision: main + path: apps/ombi-postgresql/cluster + destination: + server: https://kubernetes.default.svc + namespace: ombi + syncPolicy: + automated: + enabled: true + prune: true + selfHeal: true diff --git a/bootstrap/ombi-project.yaml b/bootstrap/ombi-project.yaml index 45853d8..cd03731 100644 --- a/bootstrap/ombi-project.yaml +++ b/bootstrap/ombi-project.yaml @@ -15,6 +15,9 @@ spec: destinations: - namespace: ombi server: https://kubernetes.default.svc + clusterResourceWhitelist: + - group: postgresql.cnpg.io + kind: Cluster namespaceResourceWhitelist: - group: "" kind: ConfigMap