For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

Deploy Cennso PostgreSQL

This guide describes how to deploy the Cennso PostgreSQL Operator and a Cennso PostgreSQL Instance to get a ready-to-use PostgreSQL cluster of two instances with async replicationOpens in a new tab.

The deployment consists of two stages, described in the next two sections:

After the deployment, you can validate your PostgreSQL cluster, create database users, and start to use your database cluster.

Tip

If any issues occur during component deployment, see the troubleshooting guide.

The following examples deploy both the operator and the instance directly to the Management Cluster. To deploy to a remote Core Cluster instead, set spec.connectionSecretRef on both CRs. For more information, see the Kubernetes cluster secret reference section.

Deploy Cennso PostgreSQL Operator

This section shows how to deploy the Cennso PostgreSQL Operator directly to the Management Cluster. After the deployment, the operator Pod runs in the {OPERATOR-NAMESPACE} Kubernetes Namespace and manages the PostgreSQL clusters that PostgreSQLInstance resources create in the {NAMESPACE-WITH-DATABASE-INSTANCES} Kubernetes Namespace.

To deploy the Cennso PostgreSQL Operator, execute the following steps:

  1. Prepare the PostgreSQLOperator Custom Resource (CR) to deploy the Cennso PostgreSQL Operator in your Management Cluster. For example:

    yaml

    Important

    The spec.storage.classes[].nodePath must be one of the paths configured in the local-path-provisioner of the target cluster. For more information, see the Storage configuration section.

    For more information about available configuration options, see the Cennso PostgreSQL Operator and Cennso PostgreSQL Operator Custom Resource Definition documents.

  2. Apply the prepared CR to your Management Cluster:

    bash
  3. Check your target cluster for the ready Cennso PostgreSQL Operator Pod:

    bash

    Check the state of the READY column in the output. As soon as all the containers within the Cennso PostgreSQL Operator Pod are ready, you can move to the deployment of the PostgreSQL cluster.

Configure TLS certificates for the PostgreSQL cluster

Note

This is an optional step. If the default TLS certificates are sufficient for your PostgreSQL cluster, move directly to the Deploy Cennso PostgreSQL Instance section.

By default, each PostgreSQL cluster uses TLS certificates requested by the Cennso PostgreSQL Operator from the cert-managerOpens in a new tab. These certificates are valid for one year, and cert-manager renews them 30 days before they expire. To customize the validity time of the TLS certificates for your PostgreSQL cluster, set the following configuration options in the PostgreSQLInstance Custom Resource:

yaml

Both values must be longer than 720h.

For more information, see the TLS certificates configuration section.

If you want to use your own TLS certificates instead, you can find more information in the Manage TLS certificates document.

Deploy Cennso PostgreSQL Instance

After you have deployed the Cennso PostgreSQL Operator, you can deploy a PostgreSQL cluster using the PostgreSQLInstance CR.

This section shows an example of how to deploy a two-instance PostgreSQL cluster directly to the Management Cluster, in the same {NAMESPACE-WITH-DATABASE-INSTANCES} Kubernetes Namespace that the operator from the Deploy Cennso PostgreSQL Operator section watches.

Note

The deployment described in this example does not contain information about the PostgreSQL exporter which collects metrics from the PostgreSQL instance(s).

To learn how to enable and configure observability for the PostgreSQL cluster, read the Enable metrics collector document.

To deploy a Cennso PostgreSQL Instance, execute the following steps:

  1. Ensure you have the Cennso PostgreSQL Operator deployed in your cluster, and the Kubernetes Namespace you want to use for the PostgreSQL cluster deployment is mentioned in the spec.watchNamespaces field of the Cennso PostgreSQL Operator CR.

  2. Ensure the StorageClass you reference in spec.instances[].storage.className exists on the target cluster. You can do this using the following command:

    bash

    The output should be similar to the following:

    text

    The example below uses postgresql-data-storage, which the operator from the Deploy Cennso PostgreSQL Operator section creates through its spec.storage.classes. Any other StorageClass capable of dynamically provisioning PersistentVolumeClaims, as for example, openebs-hostpathOpens in a new tab should work as well. PostgreSQLInstance does not require node-local paths to exist in advance if dynamic provisioning is sufficient. If you prefer node-local volumes on specific nodes, see the Scheduling and placement configuration section instead. In that case, the directories must exist on the nodes beforehand.

  3. Prepare the PostgreSQLInstance Custom Resource (CR). This CR defines the deployment target, the instance sets, and their storage. For example:

    yaml

    Important

    The spec.namespace ({NAMESPACE-WITH-DATABASE-INSTANCES}) must be listed in the operator's spec.watchNamespaces.

    The {POSTGRESQL-INSTANCE-NAME} must not exceed 38 characters. For more information, see the Naming constraint section.

    For more information about available configuration options, including PostgreSQL major-version upgrades, see the Cennso PostgreSQL Instance and Cennso PostgreSQL Instance Custom Resource Definition documents.

  4. Apply the prepared CR to your Management Cluster:

    bash
  5. Check for the ready PostgreSQL cluster pods:

    bash

    As soon as all the containers within the PostgreSQL and PgBouncerOpens in a new tab pods are ready, you can start using the database.