From 285615f195f9a28011c98b8af472c7e982c6af00 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Wed, 18 Mar 2026 21:48:33 +1100 Subject: [PATCH] feat: migrate cnpg-system from Terraform to ArgoCD - Add cnpg-system base ArgoCD application with namespace - Create cnpg-system overlay for au-syd1 with CloudNativePG Helm chart - Update platform ApplicationSet to include cnpg-system deployment - Configure cloudnative-pg operator v0.27.0 with HA and resource limits - Maintain one-to-one migration from Terraform configuration --- apps/base/cnpg-system/kustomization.yaml | 6 ++++++ apps/base/cnpg-system/namespace.yaml | 5 +++++ .../au-syd1/cnpg-system/kustomization.yaml | 14 ++++++++++++++ apps/overlays/au-syd1/cnpg-system/values.yaml | 16 ++++++++++++++++ argocd/applicationsets/platform.yaml | 1 + argocd/projects/platform.yaml | 1 + 6 files changed, 43 insertions(+) create mode 100644 apps/base/cnpg-system/kustomization.yaml create mode 100644 apps/base/cnpg-system/namespace.yaml create mode 100644 apps/overlays/au-syd1/cnpg-system/kustomization.yaml create mode 100644 apps/overlays/au-syd1/cnpg-system/values.yaml diff --git a/apps/base/cnpg-system/kustomization.yaml b/apps/base/cnpg-system/kustomization.yaml new file mode 100644 index 0000000..5122f9e --- /dev/null +++ b/apps/base/cnpg-system/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml diff --git a/apps/base/cnpg-system/namespace.yaml b/apps/base/cnpg-system/namespace.yaml new file mode 100644 index 0000000..1f89c52 --- /dev/null +++ b/apps/base/cnpg-system/namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: cnpg-system diff --git a/apps/overlays/au-syd1/cnpg-system/kustomization.yaml b/apps/overlays/au-syd1/cnpg-system/kustomization.yaml new file mode 100644 index 0000000..e58fe7c --- /dev/null +++ b/apps/overlays/au-syd1/cnpg-system/kustomization.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../../base/cnpg-system + +helmCharts: + - name: cloudnative-pg + repo: https://cloudnative-pg.github.io/charts + version: "0.27.0" + releaseName: cloudnative-pg-operator + namespace: cnpg-system + valuesFile: values.yaml diff --git a/apps/overlays/au-syd1/cnpg-system/values.yaml b/apps/overlays/au-syd1/cnpg-system/values.yaml new file mode 100644 index 0000000..f2c5fe4 --- /dev/null +++ b/apps/overlays/au-syd1/cnpg-system/values.yaml @@ -0,0 +1,16 @@ +replicaCount: 2 + +resources: + limits: + cpu: 500m + memory: 400Mi + requests: + cpu: 10m + memory: 200Mi + +podDisruptionBudget: + enabled: true + minAvailable: 1 + +monitoring: + createPodMonitor: false # Requires Prometheus Operator CRDs. diff --git a/argocd/applicationsets/platform.yaml b/argocd/applicationsets/platform.yaml index ac5cce9..6d488dd 100644 --- a/argocd/applicationsets/platform.yaml +++ b/argocd/applicationsets/platform.yaml @@ -14,6 +14,7 @@ spec: - path: apps/overlays/*/cattle-system - path: apps/overlays/*/certificates - path: apps/overlays/*/cert-manager + - path: apps/overlays/*/cnpg-system - path: apps/overlays/*/externaldns - path: apps/overlays/*/reflector-system - path: apps/overlays/*/reloader-system diff --git a/argocd/projects/platform.yaml b/argocd/projects/platform.yaml index 7cb83f6..b103a23 100644 --- a/argocd/projects/platform.yaml +++ b/argocd/projects/platform.yaml @@ -13,6 +13,7 @@ spec: - https://releases.rancher.com/server-charts/stable - https://charts.jetstack.io - https://kubernetes-sigs.github.io/external-dns/ + - https://cloudnative-pg.github.io/charts destinations: - namespace: '*-system' server: https://kubernetes.default.svc -- 2.47.3