kind: Cluster (CNPG)

From wikieduonline
Jump to navigation Jump to search

Examples[edit]

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: cluster-example 

spec:
  instances: 3
  storage:
    size: 1Gi
EOF


Including Volume snapshots[edit]

apiVersion: postgresql.cnpg.io/v1
kind: Cluster 
metadata:
  name: snapshot-cluster
spec:
 instances: 3

 storage:
   storageClass: @STORAGE_CLASS@
   size: 10Gi
 walStorage:
   storageClass: @STORAGE_CLASS@
   size: 10Gi

 backup:
   # Volume snapshot backups
   volumeSnapshot:
      className: @VOLUME_SNAPSHOT_CLASS_NAME@
   # WAL archive
   barmanObjectStore:
      # ...




kubectl get secrets
NAME                          TYPE                       DATA   AGE
cluster-example-app           kubernetes.io/basic-auth   11     4m40s
cluster-example-ca            Opaque                     2      4m40s
cluster-example-replication   kubernetes.io/tls          2      4m40s
cluster-example-server        kubernetes.io/tls          2      4m40s


kubectl patch cluster cluster-example --type merge -p '{"spec":{"instances":1}}'
kubectl delete cluster

Advertising: