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
- Please review the CPK docs for the Crunchy Bridge API and our blog post Deploy Crunchy Bridge Resources from Crunchy Postgres for Kubernetes.
- If you do not already have a Crunchy Bridge account, you will need to register for an account.
- If you’re working within a larger organization, create that team and team members.
- Create an API key for use within Kubernetes.
Provisioning
-
Create a Secret in Kubernetes for the Bridge API key.
-
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' }
- 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.