Exploring Database Resilience and Workflow Simplification in Kubernetes

Profile pictureToni Petrina

    PostgresSQL in Kubernetes: Operation - Day 2

    Operators:

    • CloudNativePG - https://cloudnative-pg.io/documentation/1.16/
    • EDB CloudNativePG - same as before, but has advanced features like compat, backup

    Automated failover Storage

    • Use PVC - automated generation; but can use templates to use storage classes
    • not Statefulsets

    Ensure that instances are not running on the same node Article: https://www.enterprisedb.com/blog/leverage-new-way-import-existing-postgres-database-kubernetes Grafana dashboard: https://grafana.com/grafana/dashboards/20417-cloudnativepg/

    Restoring entire cluster by recreating it from backup and deleting old one cnpg plugin for kubectl - https://cloudnative-pg.io/documentation/1.20/kubectl-plugin/ Connection pooling with PgBouncer

    • alternative: https://github.com/supabase/supavisor
    • alternative: https://github.com/postgresml/pgcat

    Backups:

    • on demand or on schedule

    Q: As platform engineer, how do I offer this to devs?

    From https://cloudnative-pg.io/documentation/1.16/database_import/: CloudNativePG provides two main ways to import objects from the source cluster into the destination cluster:

    • microservice approach: the destination cluster is designed to host a single application database owned by the specified application user, as recommended by the CloudNativePG project

    • monolith approach: the destination cluster is designed to host multiple databases and different users, imported from the source cluster

    Q: How to add extensions like timescale? Some are supported, but you can:

    1. create customized image
    2. ???

    Q: CDC? E.g. Debezium Yes?

    From Hero to Zero – Make Action Scripts That Can Be Debugged Locally and Execute Globally

    https://github.com/nexi-intra/template-scriptrepo


    Change code theme: