Skip to content

kmarshgov/patroni-postgres-container

 
 

Repository files navigation

TL;DR

This repo contains the Platform Service (PS) and community maintained version of PostgreSQL managed by Patroni for High Availability (HA). You will find this image in the bcgov namespace on all PS managed clusters.

oc get is -n bcgov

You will find a sample of how to deploy the image here.

Image Management

This image is based on PostgreSQL v12.4. It will be periodically rebuilt acording to the cron schedule in the workflow. When it is rebuilt, patch updates as well as operating security fixes will be incorporated and redistributed to all clusters via the stable tag.

Tags

The stable tag for this image is 2.0.1-12.4-latest. When the image is rebuilt patch updates to PostgreSQL will be incorporated along with operating system updates.

See the release notes for more information and any other unique tags.

Usage

Below is a sample of how you might reference this image from a StatefulSet deployment manifest.

  image: image-registry.openshift-image-registry.svc:5000/bcgov/patroni-postgres:12.4-latest

Find a sample StatefulSet deployment here.

ProTip 🤓

Use the internal host for the bcgov image catalog; if you use the external one (contains gov.bc.ca) you'll need to authenticate.

Build

This image is built as per the workflow and the OpenShift templates.

Distribution

Run RBAC to create an SA and bind it to, this is done on a lab or build cluster:

 kind: ClusterRole
 name: system:image-puller

Using the token from the SA above, create a docker registry secret with the appropriate credentials. For the --docker-server argument use the external registry host name.

oc create secret docker-registry bcgov-tools-klab \
  --docker-server=image-registry.foo.bar.gov.bc.ca \
  --docker-username=bcgov-images-cicd \
  --docker-password=$SATOKEN \
  --docker-email=unused

Then allow the builder service account to access the newly minted docker credentials for pulling images:

oc secrets add sa/builder secrets/bcgov-tools-klab --for=pull

And finally, create an imagestreamtag to import the image to your cluster. Again, for the -from-image argument use the external registry host name.

oc create imagestreamtag patroni-postgresql:12.4-latest \
  --from-image=image-registry.foo.bar.gov.bc.ca /bcgov-tools/patroni-postgresql:12.4-latest

Check to make sure it imported:

oc get is
oc describe is/patroni-postgresql

About

Patroni Postgres container based of the oficial Postgres images from Docker Hub

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 55.5%
  • Dockerfile 44.5%