Pg Operator
Prerequisites
This guide assumes you have the following prerequisites in place:
Zalando Postgres Operator
The Zalando Postgres Operator is an open-source project that allows you to run HA PostgreSQL in a Kubernetes cluster.
Installation
Create the following directory structure for the Pg Operator:
pg-operator/
├── pg-operator-repo.yml
└── pg-operator-release.yml
Add the following content to pg-operator/pg-operator-repo.yml:
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: postgres-operator-charts
namespace: flux-system
spec:
interval: 6h
url: https://opensource.zalando.com/postgres-operator/charts/postgres-operator
Add the following content to pg-operator/pg-operator-release.yml:
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: postgres-operator
namespace: postgres-operator
spec:
interval: 6h
chart:
spec:
chart: postgres-operator
version: "1.15.1"
sourceRef:
kind: HelmRepository
name: postgres-operator-charts
namespace: flux-system
interval: 6h
install:
createNamespace: true
upgrade:
remediation:
remediateLastFailure: true
Commit and push the changes to your Git repository. FluxCD will automatically deploy the Pg Operator to your cluster.