KubeStash PostgreSQL Addon
KubeStash v2024.9.30+
supports extending its functionality through addons. KubeStash PostgreSQL
addon enables KubeStash to backup and restore PostgreSQL
databases.
This guide will give you an overview of which PostgreSQL
versions are supported and how the docs are organized.
Supported PostgreSQL Versions
Backup Versions
To find the supported PostgreSQL
versions for backup operations in your Kubernetes cluster, you can inspect the .spec.availableVersions
field of the postgres-backup
function.
Let’s check the supported versions for backup:
$ kubectl get functions.addons.kubestash.com postgres-backup -o yaml
apiVersion: addons.kubestash.com/v1alpha1
kind: Function
metadata:
annotations:
meta.helm.sh/release-name: kubedb-kubestash-catalog
meta.helm.sh/release-namespace: stash
creationTimestamp: "2025-01-31T11:18:00Z"
generation: 1
labels:
app.kubernetes.io/instance: kubedb-kubestash-catalog
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kubedb-kubestash-catalog
app.kubernetes.io/version: v2025.1.9
helm.sh/chart: kubedb-kubestash-catalog-v2025.1.9
name: postgres-backup
resourceVersion: "47922"
uid: b54e09ea-1099-4a3b-a8ee-94921294b0f5
spec:
args:
- backup
- --namespace=${namespace:=default}
- --backupsession=${backupSession:=}
- --enable-cache=${enableCache:=}
- --scratch-dir=${scratchDir:=}
- --wait-timeout=${waitTimeout:=300}
- --pg-args=${args:=}
- --backup-cmd=${backupCmd:=}
- --user=${user:=}
availableVersions:
- "12.17"
- "14.10"
- "16.1"
- "17.2"
image: ghcr.io/kubedb/postgres-restic-plugin:v0.14.0_${DB_VERSION}
Here,
spec.availableVersions
lists the versions used to runpg_dump
orpg_dumpall
for backups, based on your database version.
Restore Versions
To find the supported PostgreSQL
versions for restore operations in your Kubernetes cluster, you can inspect the .spec.availableVersions
field of the postgres-restore
function.
Let’s check the supported versions for restore:
$ kubectl get functions.addons.kubestash.com postgres-restore -o yaml
apiVersion: addons.kubestash.com/v1alpha1
kind: Function
metadata:
annotations:
meta.helm.sh/release-name: kubedb-kubestash-catalog
meta.helm.sh/release-namespace: stash
creationTimestamp: "2025-01-31T11:18:00Z"
generation: 1
labels:
app.kubernetes.io/instance: kubedb-kubestash-catalog
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kubedb-kubestash-catalog
app.kubernetes.io/version: v2025.1.9
helm.sh/chart: kubedb-kubestash-catalog-v2025.1.9
name: postgres-restore
resourceVersion: "47896"
uid: cac78178-c1c2-4761-a848-69cb4c0bb9d6
spec:
args:
- restore
- --namespace=${namespace:=default}
- --restoresession=${restoreSession:=}
- --snapshot=${snapshot:=}
- --enable-cache=${enableCache:=}
- --scratch-dir=${scratchDir:=}
- --wait-timeout=${waitTimeout:=300}
- --pg-args=${args:=}
- --user=${user:=}
availableVersions:
- "12.17"
- "14.10"
- "16.1"
- "17.2"
image: ghcr.io/kubedb/postgres-restic-plugin:v0.14.0_${DB_VERSION}
Here,
spec.availableVersions
lists the versions used to runpsql
for restore, based on your database version.
Addon Version Compatibility
Any database version with a major version matching the supported PostgreSQL
versions should generally be able to back up the database. For instance, if the function supports the 13.x
version, it should work with any PostgreSQL
database within the 14.x
series. However, there may be exceptions where certain versions are incompatible. In such cases, use the specific version name that is explicitly supported.
Documentation Overview
KubeStash PostgreSQL
documentations are organized as below:
- How does it work? gives an overview of how backup and restore process for PostgreSQL database works in KubeStash.
- Standalone PostgreSQL Database shows how to backup and restore an externally managed PostgreSQL database.