Using Kubernetes, Docker, and Helm to Deploy On-Demand PostgreSQL Streaming Replicas
I'm a seasoned-engineer that describes myself as being "at the intersection of DBA and DevOps". As a member of the Cloud Native Computing Team at Samsung SDS - my work revolves entirely around containers (Docker), Kubernetes, and data platforms. Evolving and implementing PostgreSQL in Cloud and containerized environments has been a passion and a technical highlight in my career. I'm currently based out of the Boulder, Colorado area.
No video of the event yet, sorry!
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.
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.
- 2017 November 14 16:20
- 50 min
- PGConf Local: Seattle