bcgov / quickstart-openshift

QuickStart template targeted for OpenShift.
https://quickstart-openshift-test-frontend.apps.silver.devops.gov.bc.ca/
Apache License 2.0
30 stars 4 forks source link

Crunchy over Patroni? #1372

Open DerekRoberts opened 1 year ago

DerekRoberts commented 1 year ago

I'm liking the sound of Crunchy over Patroni. Still early.

Setup and lots of ideas courtesy of @conbrad.

  - apiVersion: postgres-operator.crunchydata.com/v1beta1
    kind: PostgresCluster
    metadata:
      name: ${APP_NAME}-${SUFFIX}
    spec:
      image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-postgres-gis:ubi8-14.7-3.2-0
      metadata:
        name: ${APP_NAME}-${SUFFIX}
        labels:
          app: ${APP_NAME}-${SUFFIX}
      users:
        - name: ${APP_NAME}-${SUFFIX}
          databases:
            - postgres
          options: "SUPERUSER"
      postgresVersion: 14
      instances:
        - name: tileserv
          replicas: 3
          dataVolumeClaimSpec:
            accessModes:
              - "ReadWriteOnce"
            resources:
              requests:
                storage: 5Gi
                cpu: 15m
                memory: 200Mi
              limits:
                cpu: 100m
                memory: 500Mi
            storageClassName: netapp-block-standard
          walVolumeClaimSpec:
            accessModes:
              - "ReadWriteOnce"
            resources:
              requests:
                storage: 2Gi
            storageClassName: netapp-block-standard
      backups:
        pgbackrest:
          image: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-pgbackrest:ubi8-2.41-4
          repos:
            - name: repo1
              volume:
                volumeClaimSpec:
                  accessModes:
                    - "ReadWriteOnce"
                  resources:
                    requests:
                      storage: 5Gi
DerekRoberts commented 1 year ago

https://github.com/bcgov/wps/blob/main/openshift/templates/tileserv/tileserv.yaml

https://access.crunchydata.com/documentation/postgres-operator/latest/tutorials/basic-setup

DerekRoberts commented 1 year ago

(comments also stolen)

Oh wow look at their upgrade path for major versions, so easy: https://access.crunchydata.com/documentation/postgres-operator/latest/guides/major-postgres-version-upgrade

Postgres Major Version Upgrade


apiVersion: postgres-operator.crunchydata.com/v1beta1

kind: PGUpgrade

metadata:

  name: hippo-upgrade

spec:

  image: registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi8-5.4.2-0

  postgresClusterName: hippo

  fromPostgresVersion: 14

  toPostgresVersion: 15
mishraomp commented 1 year ago

I am voting for crunchy @DerekRoberts , lets add that https://docs.developer.gov.bc.ca/postgres-how-to/

DerekRoberts commented 1 year ago

@mishraomp @conbrad Agreed! :)

mishraomp commented 1 year ago

I am adding it with the current HELM work I am doing . cc @DerekRoberts @conbrad https://github.com/bcgov/quickstart-openshift/issues/1454

conbrad commented 1 year ago

If y'all are still evaluating postgres cluster tooling, I came across CloudNativePG: https://cloudnative-pg.io/

It's a project managed by the CNCF that has some pretty compelling support for cross-cluster architectures: https://www.cncf.io/blog/2023/09/29/recommended-architectures-for-postgresql-in-kubernetes/

DerekRoberts commented 1 year ago

@conbrad Lol! Sure sounds like the sort of thing we should use. :D

Run PostgreSQL.
The Kubernetes way.
CloudNativePG is the Kubernetes operator that covers the full lifecycle of a highly available PostgreSQL database cluster with a primary/standby architecture, using native streaming replication.

Update: Issue!

mishraomp commented 1 year ago

@DerekRoberts @conbrad anything Cluster level we don't have access to, the platform-services team needs to be involved and they will add that as an operator for different teams to use. ATM we are limited to only Crunchy Operator. EDB was a big failure and did not have good feedback. we will focus on Crunchy atm, and since it will be used with HELM, moving to another solution should not be a problem :)