From a503b16eca04100c6cf524d904af2912d8f947ef Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 1 May 2026 14:25:49 +0700 Subject: [PATCH] feat(platform): setup CloudNativePG --- platform/staging/cloudnative-pg.yaml | 35 ++++++++++++++++++++++++++++ platform/staging/namespaces.yaml | 5 ++++ settings.yaml | 16 +++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 platform/staging/cloudnative-pg.yaml diff --git a/platform/staging/cloudnative-pg.yaml b/platform/staging/cloudnative-pg.yaml new file mode 100644 index 0000000..b006d7d --- /dev/null +++ b/platform/staging/cloudnative-pg.yaml @@ -0,0 +1,35 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: cnpg + namespace: flux-system +spec: + type: oci + interval: 1h + url: oci://registry.registry.svc.cluster.local:5000/vendor/charts/cloudnative-pg +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: cnpg + namespace: flux-system +spec: + interval: 30m + dependsOn: + - name: platform-namespaces + install: + remediation: + retries: -1 + chart: + spec: + chart: cloudnative-pg + version: 0.28.0 + sourceRef: + kind: HelmRepository + name: cnpg + releaseName: cnpg + targetNamespace: cnpg-system + values: + image: + repository: registry.registry.svc.cluster.local/vendor/images/cloudnative-pg/cloudnative-pg + tag: 1.29.0 diff --git a/platform/staging/namespaces.yaml b/platform/staging/namespaces.yaml index df454ef..fbee39f 100644 --- a/platform/staging/namespaces.yaml +++ b/platform/staging/namespaces.yaml @@ -24,6 +24,11 @@ spec: kind: Namespace forceRename: cert-manager spec: {} + cnpg-system: + apiVersion: v1 + kind: Namespace + forceRename: cnpg-system + spec: {} dex: apiVersion: v1 kind: Namespace diff --git a/settings.yaml b/settings.yaml index 7d02802..449b1e6 100644 --- a/settings.yaml +++ b/settings.yaml @@ -36,6 +36,22 @@ secrets: Enter Dex khuedoan password hash. (Generate with: echo mypassword | htpasswd -BinC 10 "" | cut -d: -f2) vendors: + vendor/charts/cloudnative-pg: + kind: chart + repo_url: https://cloudnative-pg.github.io/charts + chart: cloudnative-pg + versions: + - 0.28.0 + vendor/images/cloudnative-pg/cloudnative-pg: + kind: image + source: ghcr.io/cloudnative-pg/cloudnative-pg + versions: + - 1.29.0 + vendor/images/cloudnative-pg/postgresql: + kind: image + source: ghcr.io/cloudnative-pg/postgresql + versions: + - 17.6-system-trixie vendor/charts/dex: kind: chart repo_url: https://charts.dexidp.io -- 2.51.2