From d4e7382b7372498c0ac94fbccbdb12c84a3520c1 Mon Sep 17 00:00:00 2001 From: Wade Desir Date: Thu, 27 Jan 2022 17:14:23 -0500 Subject: [PATCH] reintroduce postgres operator example database pods (#233) Signed-off-by: Jeff McCoy --- examples/postgres-operator/README.md | 2 -- .../manifests/postgres-cluster.yaml | 28 +++++++++++++++++++ .../manifests/postgres-operator.yaml | 10 +++++++ examples/postgres-operator/zarf.yaml | 7 +++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 examples/postgres-operator/manifests/postgres-cluster.yaml diff --git a/examples/postgres-operator/README.md b/examples/postgres-operator/README.md index d57d8cb819..1ce58a767c 100644 --- a/examples/postgres-operator/README.md +++ b/examples/postgres-operator/README.md @@ -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). diff --git a/examples/postgres-operator/manifests/postgres-cluster.yaml b/examples/postgres-operator/manifests/postgres-cluster.yaml new file mode 100644 index 0000000000..fef361acf6 --- /dev/null +++ b/examples/postgres-operator/manifests/postgres-cluster.yaml @@ -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 diff --git a/examples/postgres-operator/manifests/postgres-operator.yaml b/examples/postgres-operator/manifests/postgres-operator.yaml index 474eb23c0f..1b3a7a9271 100644 --- a/examples/postgres-operator/manifests/postgres-operator.yaml +++ b/examples/postgres-operator/manifests/postgres-operator.yaml @@ -54,6 +54,8 @@ spec: runAsNonRoot: true readOnlyRootFilesystem: true allowPrivilegeEscalation: false + podServiceAccount: + name: "zalando-postgres-operator" --- apiVersion: v1 kind: ConfigMap @@ -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 \ No newline at end of file diff --git a/examples/postgres-operator/zarf.yaml b/examples/postgres-operator/zarf.yaml index e5295ebef3..7a4e5b519a 100644 --- a/examples/postgres-operator/zarf.yaml +++ b/examples/postgres-operator/zarf.yaml @@ -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 @@ -26,6 +31,7 @@ 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 @@ -33,5 +39,6 @@ components: - 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