Skip to content

Commit

Permalink
feat: add cloudnative-pg
Browse files Browse the repository at this point in the history
  • Loading branch information
rxbn committed Jul 19, 2024
1 parent 713324b commit faa83ae
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
"datasourceTemplate": "helm"
},
{
"fileMatch": ["crds\\/metallb\\/crds\\.yaml$"],
"fileMatch": [
"crds\\/metallb\\/crds\\.yaml$",
"crds\\/cloudnative-pg\\/crds\\.yaml$"
],
"matchStrings": [
"datasource=(?<datasource>.*) depName=(?<depName>.*)\\s.*tag: (?<currentValue>.*)"
]
Expand Down
1 change: 1 addition & 0 deletions base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This directory contains applications that are useful for cluster operations.
## Contents

- **cloudflare-operator** Kubernetes operator for managing Cloudflare DNS records
- **cloudnative-pg** Kubernetes operator for managing PostgreSQL databases
- **intel-gpu-plugin** Intel device plugin for Kubernetes
- **k8up** is a Kubernetes backup operator created by VSHN
- **minio** s3 compatible object storage
Expand Down
26 changes: 26 additions & 0 deletions base/cloudnative-pg/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cloudnative-pg
namespace: cnpg-system
spec:
interval: 5m
driftDetection:
mode: enabled
chart:
spec:
chart: cloudnative-pg
version: 0.21.4
sourceRef:
kind: HelmRepository
name: cloudnative-pg
namespace: flux-system
interval: 5m
values:
crds:
create: false
install:
crds: Skip
upgrade:
crds: Skip
5 changes: 5 additions & 0 deletions base/cloudnative-pg/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrelease.yaml
1 change: 1 addition & 0 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cloudnative-pg
- cloudflare-operator
- minio
- intel-gpu-plugin
Expand Down
10 changes: 10 additions & 0 deletions core/helmrepositories/cloudnative-pg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: cloudnative-pg
namespace: flux-system
spec:
interval: 30m
url: https://cloudnative-pg.io/charts/
timeout: 3m
1 change: 1 addition & 0 deletions core/helmrepositories/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ resources:
- metrics-server.yaml
- containeroo.yaml
- cilium.yaml
- cloudnative-pg.yaml
- falcosecurity.yaml
5 changes: 5 additions & 0 deletions core/namespaces/cnpg-system.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: cnpg-system
1 change: 1 addition & 0 deletions core/namespaces/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resources:
- kube-system.yaml
- usenet.yaml
- cloudflare-operator.yaml
- cnpg-system.yaml
- cert-manager.yaml
- teslamate.yaml
- minio.yaml
Expand Down
3 changes: 3 additions & 0 deletions core/notifications/slack/alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ spec:
- kind: HelmRelease
namespace: falco
name: "*"
- kind: HelmRelease
namespace: cnpg-system
name: "*"
exclusionList:
- InternalError.*failed to call webhook.*EOF
- "dial tcp: lookup.*server misbehaving"
Expand Down
2 changes: 2 additions & 0 deletions crds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This directory contains all CustomResourceDefinitions required.
## Contents

- **cert-manager** provisions let's encrypt certificates
- **cloudflare-operator** manages cloudflare dns records
- **cloudnative-pg** manages postgresql databases
- **k8up** backup operator
- **kube-prometheus-stack** monitoring stack
- **metallb** load balancer
48 changes: 48 additions & 0 deletions crds/cloudnative-pg/crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: cloudnative-pg
namespace: flux-system
spec:
interval: 30m
url: https://github.com/cloudnative-pg/cloudnative-pg.git
ref:
# renovate: datasource=github-releases depName=cloudnative-pg/cloudnative-pg
tag: v1.23.1
ignore: |
# exclude all
/*
# include deploy crds dir
!/config/crd
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cloudnative-pg-crds
namespace: flux-system
spec:
interval: 5m
prune: false
sourceRef:
kind: GitRepository
name: cloudnative-pg
healthChecks:
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
name: backups.postgresql.cnpg.io
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
name: clusterimagecatalogs.postgresql.cnpg.io
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
name: clusters.postgresql.cnpg.io
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
name: imagecatalogs.postgresql.cnpg.io
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
name: poolers.postgresql.cnpg.io
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
name: scheduledbackups.postgresql.cnpg.io
5 changes: 5 additions & 0 deletions crds/cloudnative-pg/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- crds.yaml
1 change: 1 addition & 0 deletions crds/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cloudnative-pg
- cloudflare-operator
- kube-prometheus-stack
- cert-manager
Expand Down

0 comments on commit faa83ae

Please sign in to comment.