Performing a minor version upgrade is a simple process, this type of upgrade only requires to upgrade the executable files (binaries) while the server is down. Once the files where replaced the server must be restarted.
Minor releases never change the internal storage format and are always compatible with earlier and later minor releases of the same major version number. For example, version 10.1 is compatible with version 10.0 and version 10.6. Similarly. Check Official Postgres documentation.
StackGres simplify the process to perform a minor version upgrade providing two different methods to accomplish this, using the Web Console or by the kubectl
CLI.
StackGres already provides a Database Operation
called Minor Version Upgrade
Database Operations
Click over the Plus (+) button
Then the Create Database Operation
page will be open.
Choose your target cluster
You can set the process to be executed at a specific time, if not set the process will be executed immediately.
If required you can add the Node Tolerations.
Choose the method:
Finally click on Create Operation
All the operations executed to perform the minor version upgrade will be shown in the Database Operation
detail.
In order to execute the process by using the CLI, you need to create the SGDbOps manifest. In the next example a minor version upgrade from Postgres version 16.1
to 16.2
will be performed:
To execute the process create and apply the manifest with the next command:
cat << EOF | kubectl apply -f -
apiVersion: stackgres.io/v1
kind: SGDbOps
metadata:
name: minor-v-upgrade
namespace: default
spec:
minorVersionUpgrade:
method: InPlace
postgresVersion: "16.2"
op: minorVersionUpgrade
sgCluster: demo
EOF
Check each specific parameter on the manifest, they are all the same that you can specify when using the Web Console.
Once you apply the manifest you can check the operation status with:
❯ kubectl get sgdbops.stackgres.io minor-v-upgrade
NAME CLUSTER OPERATION STATUS
minor-v-upgrade demo minorVersionUpgrade OperationRunning
You can check the operation log by checking the pods logs:
❯ kubectl logs minor-v-upgrade-g7jf8
output ommited for presentation purpose.