Kubernetes API

Crunchy Postgres for Kubernetes (CPK) has released a custom resource definition for provisioning Crunchy Bridge clusters. This feature is available in CPK versions 5.6+.

Crunchy Postgres for Kubernetes

Crunchy Postgres for Kubernetes is a full featured Kubernetes operator for self-managed Postgres. The operator contains Postgres software as well as production features for backups, connection pooling, monitoring, disaster recovery, and high availability.

You can get started with CPK from the Quickstart guide.

Get started with the Crunchy Bridge API

Provisioning

  1. Create a Secret in Kubernetes for the Bridge API key.

  2. Create a Bridge cluster Custom Resource Definition (CRD) and apply it. Here is a sample CRD file:

apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: CrunchyBridgeCluster
metadata:
  name: my-test-cluster-cr
  namespace: postgres-operator
spec:
  isHa: false
  clusterName: my-test-bridge-cluster
  plan: standard-8
  majorVersion: 15
  provider: aws
  region: us-west-2
  secret: bridge-connection-secret
  storage: 10Gi
  roles:
    - { name: 'application', secretName: 'application-role-secret' }
    - { name: 'postgres', secretName: 'postgres-role-secret' }
  1. Retrieve the connection details from the secret file:
APPLICATION_URI=$(kubectl -n postgres-operator get secrets application-role-secret -o go-template='{{.data.uri | base64decode}}')

Changing or deleting clusters

Cluster specifications contained in the CRD can be updated. This will push a resize request to Crunchy Bridge that will take place during your maintenance window, if that has been specified, or as soon as possible otherwise.

Clusters can be removed by deleting the yaml file:

kubectl delete -f myTestCluster.yaml

For additional examples, usage guides, and detailed technical documentation, refer to the CPK documentation. Visit the Crunchy Data Discord channel for additional community discussion on CPK.