Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reintroduce postgres operator example database pods #233

Merged
merged 8 commits into from
Jan 27, 2022
2 changes: 0 additions & 2 deletions examples/postgres-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

This example demonstrates deploying a performant and highly available PostgreSQL database to a Zarf airgap cluster. It uses Zalando's [postgres-operator](https://github.com/zalando/postgres-operator) and provides the Postgres Operator UI and a deployment of PGAdmin for demo purposes.

:warning: NOTE: It looks like this example doesn't currently quite work. The operators come up but it doesn't deploy a postgres database like it used to. We are working on a fix.

## Tool Choice

After looking at several alternatives, Zalando's postgres operator felt like the best choice. Other tools that were close runners-up were the postgres-operator by [CrunchyData](https://github.com/CrunchyData/postgres-operator) and [KubeDB](https://github.com/kubedb/operator).
Expand Down
28 changes: 28 additions & 0 deletions examples/postgres-operator/manifests/postgres-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: "acid.zalan.do/v1"
kind: "postgresql"
metadata:
name: "acid-zarf-test"
namespace: "postgres-operator"
labels:
team: acid
spec:
teamId: "acid"
postgresql:
version: "13"
numberOfInstances: 3
enableConnectionPooler: true
volume:
size: "2Gi"
users:
zarf: []
databases:
zarf: zarf
enableLogicalBackup: true
logicalBackupSchedule: "*/2 * * * *"
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 500Mi
10 changes: 10 additions & 0 deletions examples/postgres-operator/manifests/postgres-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ spec:
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
podServiceAccount:
name: "zalando-postgres-operator"
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -70,3 +72,11 @@ data:
WALG_DISABLE_S3_SSE: "true"
USE_WALG_RESTORE: "false"
AWS_S3_FORCE_PATH_STYLE: "true"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: zalando-postgres-operator
namespace: postgres-operator
imagePullSecrets:
- name: private-registry
7 changes: 7 additions & 0 deletions examples/postgres-operator/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ components:
required: true
manifests: manifests

scripts:
retry: true
after:
- "kubectl patch serviceaccount default -p '{\"imagePullSecrets\": [{\"name\": \"private-registry\"}]}' -n postgres-operator"

charts:
- name: postgres-operator
url: https://opensource.zalando.com/postgres-operator/charts/postgres-operator
Expand All @@ -26,12 +31,14 @@ components:
url: https://repo1.dso.mil/platform-one/big-bang/apps/application-utilities/minio.git
version: 4.2.3-bb.1


images:
- registry.opensource.zalan.do/acid/postgres-operator:v1.7.0
- registry.opensource.zalan.do/acid/spilo-13:2.1-p1
- registry.opensource.zalan.do/acid/logical-backup:v1.7.0
- registry.opensource.zalan.do/acid/pgbouncer:master-18
- registry.opensource.zalan.do/acid/postgres-operator-ui:v1.7.0
- docker.io/dpage/pgadmin4:5.5
- docker.io/rancher/pause:3.1
- registry1.dso.mil/ironbank/opensource/minio/operator:v4.2.3
- registry1.dso.mil/ironbank/opensource/minio/minio:RELEASE.2021-08-31T05-46-54Z