Upgrade
Upgrading the Operator
Various Operator releases will require action by the Operator administrator of your organization in order to upgrade to the next release of the Operator. Some upgrade steps are automated within the Operator but not all are possible at this time.
This section of the documentation shows specific steps required to upgrade different versions of the Postgres Operator depending on your current environment.
Upgrade Postgres Operator to 3.5
Postgres Operator 3.5 Minor Version Upgrade
Upgrade Postgres Operator from 3.5 to 4.1
Upgrade Postgres Operator from 4.0.1 to 4.1.0 (Bash)
Upgrade Postgres Operator from 4.0.1 to 4.1.0 (Ansible)
Upgrade Postgres Operator from 4.1.0 to a patch release
Upgrading A Postgres Cluster
Using the operator, it is possible to upgrade a postgres cluster in place. When a pgo upgrade command is issued, and a –CCPImageTag is specified, the operator will upgrade each replica and the primary to the new CCPImageTag version. It is important to note that the postgres version of the new container should be compatible with the current running version. There is currently no version check done to ensure compatibility.
The upgrade is accomplished by updating the CCPImageTag version in the deployment, which causes the old pod to be terminated and a new pod created with the updated deployment specification.
When the upgrade starts, each replica is upgraded seqentially, waiting for the previous replica to go ready before updating the next. After the replicas complete, the primary is then upgraded to the new image. The upgrade process respects the autofail and the AutofailReplaceReplica settings as provided in the pgo.yaml or as a command line flag, if applicable.
When the cluster is not in autofail mode, the deployments simply create a new pod when updated, terminating the old one. When autofail is enabled and the primary deployment is updated, the cluster behaves as though the primary had failed and begins the failover process. See Automatic Failover in the Overview section for more details on this and replica replacement.
At this time, the backrest-repo container is not upgraded during this upgrade as it is part of the postgres operator release and is updated with the operator.
Minor Upgrade Example
In this example, we are upgrading a cluster from PostgreSQL 11.5 to 11.6 using the crunchy-postgres:centos7-11.6-4.1.1
container:
pgo upgrade mycluster --ccp-image-tag=centos7-11.6-4.1.1
For more information, please see the pgo upgrade
documentation here.