Instance Update Strategy

Certain changes to the PostgreSQL instance spec requires a restart of the database to take effect. Most importantly changes to the size of the instance will need a restart of the instance to apply.

An instance’s .spec.parameters.updateStrategy field allows you to configure and disable automated restarts after an update of the PostgreSQL instance. There are two possible values:

Immediate

The Immediate strategy will automatically restart the database whenever the instance is changed. This is the default update strategy.

Please be aware that this might cause a short downtime after updating, especially for single instance databases.
OnRestart

When an instance’s .spec.parameters.updateStrategy.type is set to OnRestart, the database will not automatically be restarted. This means changes to the spec will potentially not immediately take effect. At the latest, changes will be applied during the next maintenance window.

Configuration

Example of a PostgreSQL instance with OnRestart update strategy
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
  name: pgsql-app1-restore
spec:
  parameters:
    service:
      majorVersion: "15"
      pgSettings:
        timezone: Europe/Zurich
    size:
      cpu: "600m"
      memory: "3500Mi"
      disk: "80Gi"
    updateStrategy:
      type: OnRestart (1)
  writeConnectionSecretToRef:
    name: postgres-creds
1 The update strategy OnRestart will never trigger an immediate restart after update.