CloudnativePG
Overview
The source code and default configuration of the Building Block is available on our code.syseleven.de. Infos on release notes and new features please follow Release note on CloudnativePG.
The Building Block consists of:
- An Operator for LifeCycle-Management
- Enabled PgBouncer-Pooler
- A PostgreSQL Cluster, predefined with 3 entities
- Grafana Dashboards, Podmonitors and PrometheusRules
CloudnativePG
CloudNativePG is a comprehensive open source platform designed to seamlessly manage PostgreSQL databases within Kubernetes environments, covering the entire operational lifecycle from initial deployment to ongoing maintenance. The main component is the CloudNativePG operator (as cited in in the official readme).
Prerequisites On CloudnativePG
The Building Block as a DBMS-Application is preconfigured as scalable setup. This means you need at least three (3) Nodes to efficiently run this application.
Make sure that:
- you have at least three Compute nodes up and running on your MetaKube Core Cluster
- Each node should be sufficient in CPU and Memory
For the best experience it is recommended to use the Kube-Prometheus-Stack Building Block.
Recommended Setup
| CPU/vCPU | Memory | Storage |
|---|---|---|
| 9 | 18472MiB | up to 100 GB |
Adding the Building Block
You are good to go with the recommended cluster configuration to meet the pg-operator recommended configuration. Keep in mind that it also needs to fit your use case and your requirements.
First add a pg-operator directory inside our control repository. For example:
Create a .gitlab-ci.yaml inside this directory and paste the following content.
include:
- project: syseleven/building-blocks/helmfiles/cloudnative-pg
file: JobDevelopment.yaml
ref: { { site.building_blocks.cloudnative-pg.version|e } }
Advanced Configuration
For this Building Block you need to fulfill some prerequisites to follow our recommendation to configure an automatic backup.
To get your S3 keys use the OpenStack command.
openstack ec2 credentials list
# get your access key within the first coloum called **Acccess**
openstack ec2 credentials show <Access>
# fetch the values from the field **access** for the AWS_ACCESS_KEY_ID and secret for the AWS_SECRET_ACCESS_KEY
see a detailed instruction and more here
Go to your GitLab repository Settings -> CICD - Variables and enter the above requested attributes as the environment variables S3_ACCESS_KEY S3_SECRET_KEY. They are used in the values-cloudnative-pg-cluster.yaml.gotmpl to create the values for the keys backups.s3.accessKey and backups.s3.secretKey.
When done, add the following Value to values-cloudnative-pg-cluster(-$ENVIRONMENT), where $ENVIRONMENT is one of the supported cluster environments. We provide templates for the environments development, staging and operation:
Further Topics
Distributed Storage vs Local Storage
The Building Block is designed for the default Storageclass sys11-quobyte-external-provisioner.
To use local storage, please follow the Instructions on local-path-provisioner and add the configuration on cluster.affinity.
Release Notes
Please find more infos on release notes and new features Release notes CloudnativePG.