Time: 14:00 - 14:50
Using Kubernetes/Docker/Helm to Deploy On-Demand PostgreSQL Streaming Replicas
PostgreSQL running in Containers with Kubernetes – some practical use cases and dispelling myths regarding databases in Containers
There are many use-cases for running databases in containers – this presentation will focus on pragmatic examples of using Kubernetes to orchestrate Postgres streaming replicas for on-demand disaster recovery and horizontal scaling.
Containers are big news – they are the latest evolution in infrastructure technology and are poised to represent the next major shift in database workflows. As they are rapidly becoming an essential weapon in every DBA's arsenal – so let's take a look at what a Docker container represents to the RDBMS world, the relevant portions of the Kubernetes architecture, and a live demonstration of Postgres in action with Docker/Kubernetes.
Solutions Deploying Standalone Postgres Instances (then manually setting up Streaming Replication by hand) My first attempt at using Postgres with Kubernetes involved basic discovery and use of deploying vanilla Postgres Docker images; then manually setting up streaming replication. I found the generic Docker image to be rather inflexible – so I developed a derived version of the official Postgres Docker image that allows for full customization of configuration through the use of image tags and ConfigMaps.
Deploying "automagic" Postgres Streaming Replicas using pgBaseBackup (and what comes next if pgBaseBackup isn't an option) The next iteration of my work resulted in the ability to automatically build Postgres streaming replicas on-the-fly Pods via the use of standard tooling – e.g. pgBaseBackup. Using Kubernetes Init Containers ( https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) - we were able to automate the process such that it requires only a few configurable values from the Helm chart, then the process autonomously adds streaming replicas (as fast as the network connection and container resources allow). This is the preferred solution as it uses tooling that every Postgres DBA is familiar with and doesn't require outside tooling.
Day-to-day DBA Tasks for PostgreSQL instances running on Containers/Kubernetes Finally – I'll demonstrate the flexibility and power of Containers and Kubernetes for everyday DBA tasks to dispel the myths regarding how Postgres instances are run and managed in containerized-environments.
The following slides have been made available for this session: