From 34ad959d546a086d3abecf2b2367a7df624decb3 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Wed, 4 Oct 2023 19:48:19 +0000 Subject: [PATCH] Adding crunchy postgres. --- .../apps/database/crunchy-postgres/ks.yaml | 15 +++++++++++++ .../operator/helmrelease.yaml | 22 +++++++++++++++++++ .../operator/kustomization.yaml | 7 ++++++ kubernetes/apps/database/kustomization.yaml | 9 ++++++++ kubernetes/apps/database/namespace.yaml | 7 ++++++ .../flux/repositories/helm/crunchydata.yaml | 12 ++++++++++ .../flux/repositories/helm/kustomization.yaml | 1 + 7 files changed, 73 insertions(+) create mode 100644 kubernetes/apps/database/crunchy-postgres/ks.yaml create mode 100644 kubernetes/apps/database/crunchy-postgres/operator/helmrelease.yaml create mode 100644 kubernetes/apps/database/crunchy-postgres/operator/kustomization.yaml create mode 100644 kubernetes/apps/database/kustomization.yaml create mode 100644 kubernetes/apps/database/namespace.yaml create mode 100644 kubernetes/flux/repositories/helm/crunchydata.yaml diff --git a/kubernetes/apps/database/crunchy-postgres/ks.yaml b/kubernetes/apps/database/crunchy-postgres/ks.yaml new file mode 100644 index 0000000..ed0b4d8 --- /dev/null +++ b/kubernetes/apps/database/crunchy-postgres/ks.yaml @@ -0,0 +1,15 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: cluster-apps-crunchy-postgres-operator + namespace: flux-system +spec: + interval: 10m + path: "./kubernetes/cluster-0/apps/database/crunchy-postgres-operator/operator" + prune: true + sourceRef: + kind: GitRepository + name: home-ops-kubernetes + wait: true diff --git a/kubernetes/apps/database/crunchy-postgres/operator/helmrelease.yaml b/kubernetes/apps/database/crunchy-postgres/operator/helmrelease.yaml new file mode 100644 index 0000000..56d0caf --- /dev/null +++ b/kubernetes/apps/database/crunchy-postgres/operator/helmrelease.yaml @@ -0,0 +1,22 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta1.json +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: crunchy-postgres-operator + namespace: database +spec: + interval: 30m + chart: + spec: + chart: pgo + version: 5.4.2 + sourceRef: + kind: HelmRepository + name: crunchydata + namespace: flux-system + interval: 5m + install: + crds: CreateReplace + upgrade: + crds: CreateReplace diff --git a/kubernetes/apps/database/crunchy-postgres/operator/kustomization.yaml b/kubernetes/apps/database/crunchy-postgres/operator/kustomization.yaml new file mode 100644 index 0000000..77d34c3 --- /dev/null +++ b/kubernetes/apps/database/crunchy-postgres/operator/kustomization.yaml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: database +resources: + - ./helmrelease.yaml diff --git a/kubernetes/apps/database/kustomization.yaml b/kubernetes/apps/database/kustomization.yaml new file mode 100644 index 0000000..77faf48 --- /dev/null +++ b/kubernetes/apps/database/kustomization.yaml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + # Pre Flux-Kustomizations + - ./namespace.yaml + # Flux-Kustomizations + - ./crunchy-postgres/ks.yaml diff --git a/kubernetes/apps/database/namespace.yaml b/kubernetes/apps/database/namespace.yaml new file mode 100644 index 0000000..5cad286 --- /dev/null +++ b/kubernetes/apps/database/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: database + labels: + kustomize.toolkit.fluxcd.io/prune: disabled diff --git a/kubernetes/flux/repositories/helm/crunchydata.yaml b/kubernetes/flux/repositories/helm/crunchydata.yaml new file mode 100644 index 0000000..49480f8 --- /dev/null +++ b/kubernetes/flux/repositories/helm/crunchydata.yaml @@ -0,0 +1,12 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrepository-source-v1beta2.json +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: crunchydata + namespace: flux-system +spec: + type: oci + interval: 30m + url: oci://registry.developers.crunchydata.com/crunchydata + timeout: 3m diff --git a/kubernetes/flux/repositories/helm/kustomization.yaml b/kubernetes/flux/repositories/helm/kustomization.yaml index 1ba2b62..30d3e6b 100644 --- a/kubernetes/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/flux/repositories/helm/kustomization.yaml @@ -8,6 +8,7 @@ resources: - cilium.yaml - cloudnative-pg.yaml - crowdsec.yaml + - crunchydata.yaml - dragonflydb.yaml - elastic.yaml - external-secrets.yaml