This section shows how to upgrade the StackGres operator.
StackGres recommended upgrade is performed from the published Helm chart or through OperatorHub (this second option is only available if OLM is installed).
Details how to use Helm to upgrade the operator.
Details how to upgrade the operator with OperatorHub.
After the upgrade completes, any new SGCluster, SGShardedCluster or SGDistributedLogs will be created with the updated components.
Existing SGClusters, SGShardedClusters and SGDistributedLogs will work using the previous version of the operator.
In order for the existing SGClusters, SGShardedClusters and SGDistributedLogs to make use of all the new functionalities and bugfixes available in the updated operator version, an SGDbOps security upgrade for all existing SGCluster and SGDistributedLogs or an SGShardedDbOps security upgrade for all existing SGShardedCluster has to be performed. Since this operation require restarting the primary Postgres instance it should be performed during a maintenance window.
The security upgrade operation will change the version of the SGCluster, SGShardedCluster or SGDistributedLogs resources to the latest one and will perform a restart of the all the Pods by re-creating them. There are two methods to perform such a security upgrade: InPlace and ReducedImpact. While both methods are similar in what they accomplish, they differ in the impact they have on the throughput of the read-only connections. The InPlace method restarts one pod at a time without increasing the total number of running Pods. The ReducedImpact method update create one additional temporary Pod during operation (n + 1), so that the impact on read-only throughput is reduced.
After the upgrade, the YAMLs files of StackGres custom resources that are hosted externally (such as local files, Git, Helm) of the Kubernetes cluster may require some changes. Please read carefully the following sections that includes the changes provided by each operator release that affect the same minor version of StackGres custom resources and update the YAMLs stored outside the Kubernetes API accordingly.
NOTE: the operator upgrades automatically the StackGres custom resources that are created into the Kubernetes cluster, such as adding new default sections, renaming a field, migrate from one section to another, or even create new resources. In some cases, the StackGres resources that are stored as YAML files and updated using
kubectl apply
may lead to errors if the resource updates weren’t reflected in the YAML files, accordingly. This behavior is mitigated if the version of kubectl and Kubernetes you are using supports server-side apply.
1.15
.spec.metadata.annotations.pods
has been replaced by .spec.metadata.annotations.clusterPods
.spec.scripts
array now requires a unique id
field to be specified when using server-side apply to update the custom resource.1.14
.spec.prometheus.allowAutobind
has been replaced by .spec.collector.prometheusOperator.allowDiscovery
..spec.prometheusAutobind
has been replaced by .spec.configurations.observability.prometheusAutobind
..spec.prometheusAutobind
has been replaced by .spec.configurations.observability.prometheusAutobind
.1.3
.spec.configurations.sgBackupConfig
has been deprecated and is replaced by .spec.configurations.backups[0].sgObjectStorage
..spec.configurations.backupPath
has been deprecated and is replaced by .spec.configurations.backups[0].path
..spec.initialData.scripts
has been deprecated and is replaced by .spec.managedSql
and stackgres.io/v1/SGScript..spec.configurations.backups[0]
under stackgres.io/v1/SGCluster.spec.containers
and .spec.initContainers
section with default memory and CPU resources requests and limits restrictions were added. Those resources requests and limits
are applied by default to the cluster’s Pods for new stackgres.io/v1/SGCluster. For existing stackgres.io/v1/SGCluster the field .spec.nonProductionOptions.disableClusterResourceRequirements
is set to true
in order to maintain the previous memory and CPU resources requests and limits restrictions that are only enforced on the patroni container.1.2
.status.sgBackupConfig.baseBackups.performance.maxDiskBandwitdh
has been deprecated and is replaced by .status.sgBackupConfig.baseBackups.performance.maxDiskBandwidth
.status.sgBackupConfig.baseBackups.performance.maxNetworkBandwitdh
has been deprecated and is replaced by .status.sgBackupConfig.baseBackups.performance.maxNetworkBandwidth
.spec.baseBackups.performance.maxDiskBandwitdh
has been deprecated and is replaced by .spec.baseBackups.performance.maxDiskBandwidth
.spec.baseBackups.performance.maxNetworkBandwitdh
has been deprecated and is replaced by .spec.baseBackups.performance.maxNetworkBandwidth
.status.labelPrefix
with default value of an empty string..status.labelPrefix
with default value of an empty string.1.1
.spec.flavor
with default value of vanilla
.