feat: Added cnpg

This commit is contained in:
2025-12-15 03:13:39 +01:00
parent be1c67d665
commit d5c6429205
13 changed files with 106 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ resources:
- ../../controllers/spegel/spegel.yaml
- ../../controllers/longhorn/longhorn.yaml
- ../../controllers/local-path-provisioner/local-path-provisioner.yaml
- ../../controllers/cnpg/cnpg.yaml
- ../../configs/artifacts.yaml
- ../../configs/letsencrypt/letsencrypt.yaml

View File

@@ -37,5 +37,10 @@ spec:
- name: local-path-provisioner
originRevision: "@foundation"
copy:
- from: "@foundation/controllers/local-path-provisioner/**"
- from: "@foundation/controllers/local-path-provisioner**"
to: "@artifact/"
- name: cnpg
originRevision: "@foundation"
copy:
- from: "@foundation/controllers/cnpg/**"
to: "@artifact/"

View File

@@ -0,0 +1,29 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cnpg
namespace: cnpg-system
spec:
interval: 12h
install:
strategy:
name: RetryOnFailure
retryInterval: 2m
upgrade:
strategy:
name: RetryOnFailure
retryInterval: 3m
chart:
spec:
chart: cloudnative-pg
version: "0.27.x"
sourceRef:
kind: HelmRepository
name: cnpg
interval: 24h
valuesFrom:
- kind: ConfigMap
name: values-base
- kind: ConfigMap
name: values-overlay
optional: true

View File

@@ -0,0 +1,8 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: cnpg
namespace: cnpg-system
spec:
interval: 24h
url: https://cloudnative-pg.github.io/charts

View File

@@ -0,0 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- helm-repository.yaml
- helm-release.yaml
configurations:
- name-reference.yaml
configMapGenerator:
- name: values-base
namespace: cnpg-system
files:
- values.yaml

View File

@@ -0,0 +1,6 @@
nameReference:
- kind: ConfigMap
version: v1
fieldSpecs:
- path: spec/valuesFrom/name
kind: HelmRelease

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: cnpg-system

View File

View File

@@ -0,0 +1,15 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cnpg
namespace: flux-system
spec:
interval: 1h
retryInterval: 2m
timeout: 5m
sourceRef:
kind: ExternalArtifact
name: cnpg
path: ./${cluster_env}
prune: true
wait: true

View File

@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
configMapGenerator:
- name: values-overlay
namespace: cnpg-system
files:
- values.yaml

View File

@@ -0,0 +1 @@
replicaCount: 2

View File

@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
configMapGenerator:
- name: values-overlay
namespace: cnpg-system
files:
- values.yaml

View File

@@ -0,0 +1 @@
replicaCount: 1