Presented by:

No video of the event yet, sorry!

Benefit of adopting Kubernetes for self-hosted PostgreSQL stack

The talk aimed for any small/medium company where the sysadmin team manages multiple instances of PostgreSQL as part of their application. The focus is to help these companies decide if Kubernetes adoption is worth for them by highlighting the possible benefit and burden in adopting these technology.

As a background info, our company, Kartoza, focuses on building an open source GIS solution. We have several different solution and application, deployed to many and different client. Most of the solution uses PostgreSQL with PostGIS as the RDBMS store. We adopt Kubernetes with the goal of easily self-host, provision, and manage many different PostgreSQL instance with different version, extensions, and connected applications. Sometimes we have to deploy it on-prem too. Learning from these experience, we thought our current approach will benefit the community that is struggling with the same problem.

Main benefit for a small/medium company in adopting Kubernetes as a platform for their self-hosted PostgreSQL stack:

  • Reduce maintenance burden and instead focus on developing the application itself
  • Easily migrate and snapshot the database state
  • A safe and easy way to proxy database connection from the cloud to local development machine
  • Uniform way to manage the instances, even though we change cloud provider
  • Uniform way of deploying it to your client machine, on-prem
  • Access to any other Kubernetes based tools, such as monitoring and container storage interface
  • Ease transition from on-prem to cloud based deployment

In demonstrating the benefit, we will show a certain use-case of deploying a PostgreSQL stack. We will demonstrate a reproducible document and range of tools used to create and access this instance. These tools will include:

  • A Kubernetes Distro, we choose K3S
  • Access and manage kubeconfig file, we choose Visual Studio Code or Lens
  • PgAdmin as web UI to access PostgreSQL
  • PostgreSQL Helm chart to install Postgres itself
  • Cert-manager Helm chart to create certificates for Postgres TLS
  • Storage provider, such as Rancher local volumes, SMB CSI driver, or Longhorn

The above tools are the common setup. For the demo, we use some specific tools to show that it is practical:

  • Visual Studio Code to initiate proxy to the postgres instance
  • PostGIS extension, because we are showing spatial data
  • QGIS to demonstrate an application that uses the postgres connection from the cluster

2021 October 5 14:20 SAST
40 min
South Africa 2021
Ops & Administration