From d458420cbf9136fd964fed6fb2f0b20abb40a2a2 Mon Sep 17 00:00:00 2001 From: sirius0xdev Date: Mon, 5 Jan 2026 23:03:09 +0000 Subject: [PATCH] added cnpg controller --- clusters/devops-lab/kustomization.yaml | 0 clusters/infra-configs.yaml | 18 +++++++++++++++++ clusters/infra-controllers.yaml | 18 +++++++++++++++++ infrastructure/base/cnpg/kustomization.yaml | 6 ++++++ infrastructure/base/cnpg/namespace.yaml | 0 infrastructure/base/cnpg/release.yaml | 20 +++++++++++++++++++ infrastructure/base/cnpg/repository.yaml | 8 ++++++++ .../staging/cnpg/kustomization.yaml | 4 ++++ 8 files changed, 74 insertions(+) create mode 100644 clusters/devops-lab/kustomization.yaml create mode 100644 clusters/infra-configs.yaml create mode 100644 clusters/infra-controllers.yaml create mode 100644 infrastructure/base/cnpg/kustomization.yaml create mode 100644 infrastructure/base/cnpg/namespace.yaml create mode 100644 infrastructure/base/cnpg/release.yaml create mode 100644 infrastructure/base/cnpg/repository.yaml create mode 100644 infrastructure/staging/cnpg/kustomization.yaml diff --git a/clusters/devops-lab/kustomization.yaml b/clusters/devops-lab/kustomization.yaml new file mode 100644 index 0000000..e69de29 diff --git a/clusters/infra-configs.yaml b/clusters/infra-configs.yaml new file mode 100644 index 0000000..615f320 --- /dev/null +++ b/clusters/infra-configs.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infrastructure-configs + namespace: flux-system +spec: + interval: 1m0s + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/configs/staging + prune: true + decryption: + provider: sops + secretRef: + name: sops-age diff --git a/clusters/infra-controllers.yaml b/clusters/infra-controllers.yaml new file mode 100644 index 0000000..fffd1f5 --- /dev/null +++ b/clusters/infra-controllers.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: infrastructure-controllers + namespace: flux-system +spec: + interval: 1m0s + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/controllers/staging + prune: true + decryption: + provider: sops + secretRef: + name: sops-age diff --git a/infrastructure/base/cnpg/kustomization.yaml b/infrastructure/base/cnpg/kustomization.yaml new file mode 100644 index 0000000..70525aa --- /dev/null +++ b/infrastructure/base/cnpg/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - namespace.yaml + - repository.yaml + - release.yaml diff --git a/infrastructure/base/cnpg/namespace.yaml b/infrastructure/base/cnpg/namespace.yaml new file mode 100644 index 0000000..e69de29 diff --git a/infrastructure/base/cnpg/release.yaml b/infrastructure/base/cnpg/release.yaml new file mode 100644 index 0000000..b232851 --- /dev/null +++ b/infrastructure/base/cnpg/release.yaml @@ -0,0 +1,20 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: cnpg + namespace: flux-system +spec: + targetNamespace: cnpg-system + interval: 30m + chart: + spec: + chart: cloudnative-pg + version: "0.26.1" + sourceRef: + kind: HelmRepository + name: cnpg + namespace: flux-system + interval: 12h + install: + createNamespace: true + diff --git a/infrastructure/base/cnpg/repository.yaml b/infrastructure/base/cnpg/repository.yaml new file mode 100644 index 0000000..c8c5f25 --- /dev/null +++ b/infrastructure/base/cnpg/repository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: cnpg + namespace: flux-system +spec: + interval: 24h + url: https://cloudnative-pg.github.io/charts/ diff --git a/infrastructure/staging/cnpg/kustomization.yaml b/infrastructure/staging/cnpg/kustomization.yaml new file mode 100644 index 0000000..9d4dc7d --- /dev/null +++ b/infrastructure/staging/cnpg/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base/cnpg/