Logical PostgreSQL Backup

If it hasn't been done already, the bitnami Helm repository needs to be added to your local configuration:

# Add bitnami helm repo
$ helm repo add bitnami https://charts.bitnami.com/bitnami

Install the PostgreSQL chart from the bitnami Helm repository:

$ kubectl create namespace postgresql
$ helm install --namespace postgresql postgres bitnami/postgresql

The following command can be used to create the PostgreSQL Blueprint in the K10 namespace.

$ kubectl --namespace kasten-io apply -f \
    https://raw.githubusercontent.com/kanisterio/kanister/0.108.0/examples/postgresql/blueprint-v2/postgres-blueprint.yaml

For PostgreSQL App Versions 14.x or older, Kanister tools version 0.85.0 is required.

$ kubectl --namespace kasten-io apply -f \
    https://raw.githubusercontent.com/kanisterio/kanister/0.85.0/examples/postgresql/blueprint-v2/postgres-blueprint.yaml

Note

The PostgreSQL backup example provided above serve as a blueprint template for logical backups. Please note that these examples may need to be modified for specific production environments and setups. As a result, it is highly recommended to carefully review and modify the blueprints as needed before deploying them for production use.

Alternatively, use the Blueprints page on K10 Dashboard to create the Blueprint resource.

Once the Blueprint is created, add an annotation on the PostgreSQL Deployment to instruct K10 to use the Blueprint when performing operations on this PostgreSQL instance.

$ kubectl --namespace postgresql annotate statefulset/postgres-postgresql \
    kanister.kasten.io/blueprint=postgres-bp

Finally, use K10 to backup and restore the application.