CloudnativePG Installation
CloudnativePG is the Kubernetes operator that covers the full lifecycle of a highly available PostgreSQL database cluster with a primary/standby architecture.
CloudnativePG will be installed on 🟢 Management Kubernetes Clusters.
Installation
Section titled “Installation”-
Connect to
🟢 ManagementKubernetes Cluster ; _i.e w/ Kubeconfig File.Set Kubeconfig File
Ensure you have defined and loaded your Global Shell Variables as described in Shell Variables.
Terminal window source $HOME/opstella-installation/shell-values/kubernetes/management_cluster.vars.shTerminal window export KUBECONFIG="$HOME/opstella-installation/kubeconfigs/management_cluster.yaml" -
Create Namespace for CloudnativePG Controller
Terminal window kubectl create namespace cnpg-system -
Add CloudnativePG Helm Repository
Terminal window helm repo add cnpg https://cloudnative-pg.github.io/chartshelm repo update -
Create Helm Values Configurations for Operator
Terminal window cat <<EOF > $HOME/opstella-installation/helm-values/cnpg-full-values.yaml# CloudNativePG Operator Helm Values (Chart v0.27.0)replicaCount: 1image:repository: ghcr.io/cloudnative-pg/cloudnative-pgpullPolicy: IfNotPresent# tag: "" # Overrides default tag# Enable CRD creation by the chartcrds:create: true# Operator configurationconfig:create: truename: cnpg-controller-manager-configclusterWide: truemonitoring:podMonitorEnabled: false # Enabled per-cluster in the Cluster manifest usually# Monitoring / Prometheus Operator integrationmonitoring:podMonitorEnabled: false # This is for monitoring the operator itself, usually not needed unless debugging operatorEOF -
Create Helm Values Configurations for Barman Plugin
Terminal window cat <<EOF > $HOME/opstella-installation/helm-values/cnpg-barman-full-values.yaml# Production overrides for CNPG Barman Cloud Plugin# Version: 0.4.0# Resource Limits for Productionresources:limits:cpu: 200mmemory: 256Mirequests:cpu: 100mmemory: 128MiEOF -
Install CloudnativePG Helm Release
Terminal window helm upgrade --install cnpg cnpg/cloudnative-pg \--version 0.27.0 \--namespace cnpg-system \-f $HOME/opstella-installation/helm-values/cnpg-full-values.yaml -
Install CloudnativePG Barman Plugin Helm Release
Terminal window helm upgrade --install cnpg-plugin-barman cnpg/plugin-barman-cloud \--version 0.4.0 \--namespace cnpg-system \-f $HOME/opstella-installation/helm-values/cnpg-barman-full-values.yaml
Post-Installation
Section titled “Post-Installation”CloudnativePG Testing
Section titled “CloudnativePG Testing”-
Get Pod Status - CloudnativePG Controller
Terminal window kubectl get pods -n cnpg-system💡 CloudnativePG Controller and Barman Plugin should be
RunningNAME READY STATUS RESTARTS AGE... (deducted)cnpg-cloudnative-pg-XXXXXXXX-YYYYYY 1/1 Running 0 XdXhcnpg-plugin-barman-XXXXXXXX-YYYYYY 1/1 Running 0 XdXh
Finished?
Use the below navigation to proceed