Skip to content

Commit 5d1e5b6

Browse files
tjmoore4jkatz
authored andcommitted
Update Postgres Operator Upgrade Procedures to Match Updated Code Behavior
In line with commit "Update cluster upgrade" #1027 The upgrade procedures have been updated. For the PGO 4.0.1 to 4.1.0 upgrade procedure, the new functionality is referenced in place of the previous manner of executing the upgrade. For the PGO 3.5 Minor Version upgrade procedure, the upgrade procedure has been updated so that the behavior will match the updated 4.1.0 code change.
1 parent f573f6d commit 5d1e5b6

File tree

2 files changed

+40
-19
lines changed

2 files changed

+40
-19
lines changed

hugo/content/Upgrade/upgrade35.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,41 @@ Verify this by running:
8080

8181
At this point, the Operator should be running the latest minor version of 3.5, and new clusters will be built using the appropriate specifications defined in your pgo.yaml file. For the existing clusters, upgrades can be performed with the following steps.
8282

83-
To bring your clusters up to the latest versions of Containers, for each of your clusters you will want to run the following:
83+
{{% notice info %}}
84+
85+
Before beginning your upgrade procedure, be sure to consult the [Compatibility Requirements Page]
86+
( {{< relref "configuration/compatibility.md" >}}) for container dependency information.
87+
88+
{{% / notice %}}
89+
90+
First, update the deployment of each replica, one at a time, with the new image version:
91+
92+
```
93+
kubectl edit deployment.apps/yourcluster
8494
```
85-
pgo scaledown <clustername> --query
86-
pgo scaledown <clustername> --target=<replica-name> --delete-data
95+
then edit the line containing the image value, which will be similar to the following
96+
```
97+
image: crunchydata/crunchy-postgres:centos7-11.3-2.4.0
8798
```
88-
When you scale down the cluster you have the option of passing in the --delete-data flag on the pgo scaledown command. If you do this the pvc bound to your pod will also be deleted. If for some reason you need to keep the pvc around, you can remove this flag.
8999

90-
Now that your cluster only has one pod you can run the minor upgrade:
100+
When this new deployment is written, it will kill the pod and recreate it with the new image. Do this for each replica, waiting for the previous pod to upgrade completely before moving to next.
91101

92-
pgo upgrade <clustername>
102+
Once the replicas have been updated, update the deployment of primary by updating the `image:` line in the same fashion, waiting for it to come back up.
93103

94-
Once the minor upgrade is done you can scale your cluster back to the previous number of replicas:
104+
Now, similar to the steps above, you will need to update the pgcluster `ccpimagetag:` to the new value:
105+
```
106+
kubectl edit pgcluster yourcluster
107+
```
95108

96-
pgo scale <clustername> --replica-count=1
109+
To check everything is now working as expected, execute
110+
```
111+
pgo test yourcluster
112+
```
113+
To validate the database connections and execute
114+
```
115+
pgo show cluster yourcluster
116+
```
117+
To check the various cluster elements are listed as expected.
97118

98119
There is a bug in the operator where the image version for the backrest repo deployment is not updated with a pgo upgrade. As a workaround for this you need to redeploy the backrest shared repo deployment with the correct image version.
99120

hugo/content/Upgrade/upgrade40to41.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,23 @@ Verify this by running:
163163

164164
At this point, the Operator will be running version 4.1.0, and new clusters will be built using the appropriate specifications defined in your pgo.yaml file. For the existing clusters, upgrades can be performed with the following steps.
165165

166-
To bring your clusters up to the latest versions of Postgres and Containers, for each of your clusters you will want to run the following:
167-
```
168-
pgo scaledown <clustername> --query
169-
pgo scaledown <clustername> --target
170-
```
166+
{{% notice info %}}
171167

172-
Now that your cluster only has one pod you can run the minor upgrade:
168+
Before beginning your upgrade procedure, be sure to consult the [Compatibility Requirements Page]
169+
( {{< relref "configuration/compatibility.md" >}}) for container dependency information.
173170

174-
pgo upgrade cluster <clustername>
171+
{{% / notice %}}
175172

176-
By default this command updates the cluster with the values in the pgo.yaml. If however you are running more than one version of Postgres clusters you can run the following to upgrade any clusters that do not match what is in your current configuration.
173+
To start, execute the minor upgrade command:
177174

178-
pgo upgrade <clustername> --ccp-image-tag=<imagetag>
175+
pgo upgrade cluster <clustername>
179176

180-
Once the minor upgrade is done you can scale your cluster back to the previous number of replicas, for example:
177+
If you would like to know more about the Postgres Cluster minor upgrade, please see the [Upgrade Page]
178+
( {{< relref "upgrade/_index.md" >}}) for additional information.
181179

182-
pgo scale <clustername> --replica-count=2
180+
By default this command updates the cluster with the values in the pgo.yaml. If however you are running more than one version of Postgres clusters you can run the following command to upgrade any clusters that do not match what is in your current configuration.
181+
182+
pgo upgrade <clustername> --ccp-image-tag=<imagetag>
183183

184184
There is a bug in the operator where the image version for the backrest repo deployment is not updated with a pgo upgrade. As a workaround for this you need to redeploy the backrest shared repo deployment with the correct image version.
185185

0 commit comments

Comments
 (0)