Skip to content

Commit 0bbe415

Browse files
benjaminjbandrewlecuyer
authored andcommitted
Add docs on removing PVC labels
When migrating from v4 to v5, some legacy labels may remain and cause unintended behavior. This PR adds documentation around that issue and the manual fix (done manually to avoid PGO having to remove labels). Issue [sc-14477]
1 parent 2c2f68f commit 0bbe415

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

docs/content/guides/data-migration.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,26 @@ With the above configuration in place, your existing PVC will be used when creat
5454

5555
## Considerations
5656

57-
- Additional steps are required to set proper file permissions when using certain storage options, such as NFS and HostPath storage due to a known issue with how fsGroups are applied. When migrating from PGO v4, this will require the user to manually set the group value of the pgBackRest repo directory, and all subdirectories, to `26` to match the `postgres` group used in PGO v5. Please see [here](https://github.com/kubernetes/examples/issues/260) for more information.
57+
### Removing legacy labels
58+
59+
When migrating data volumes from v4 to v5, PGO will add new required labels to the PVCs, but **it will not remove existing labels**. The result is that a PVC might have labels that identify it as both a v4 and a v5 product, which can lead to unintended behavior.
60+
61+
To avoid that, you must manually remove the `pg-cluster` and `vendor` labels, which you can do with a `kubectl` command. For instance, given a cluster named `hippo` with a dedicated pgBackRest repo, the PVC will be `hippo-pgbr-repo`, and the legacy labels can be remove with the below command:
62+
63+
```
64+
kubectl label pvc hippo-pgbr-repo \
65+
pg-cluster- \
66+
vendor-
67+
```
68+
69+
### Proper file permissions for certain storage options
70+
71+
Additional steps are required to set proper file permissions when using certain storage options, such as NFS and HostPath storage due to a known issue with how fsGroups are applied.
72+
73+
When migrating from PGO v4, this will require the user to manually set the group value of the pgBackRest repo directory, and all subdirectories, to `26` to match the `postgres` group used in PGO v5. Please see [here](https://github.com/kubernetes/examples/issues/260) for more information.
74+
75+
### Additional Considerations
76+
5877
- An existing pg_wal volume is not required when the pg_wal directory is located on the same PVC as the pgData directory.
5978
- When using existing pg_wal volumes, an existing pgData volume **must** also be defined to ensure consistent naming and proper bootstrapping.
6079
- When migrating from PGO v4 volumes, it is recommended to use the most recently available version of PGO v4.

docs/content/upgrade/v4tov5/upgrade-method-1-data-volumes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ spec:
9898

9999
Please see the [Data Migration]({{< relref "guides/data-migration.md" >}}) section of the [tutorial]({{< relref "tutorial/_index.md" >}}) for more details on how to properly populate this section of the spec when migrating from a PGO v4 cluster.
100100

101+
{{% notice info %}}
102+
Note that when migrating data volumes from v4 to v5, PGO will add new required labels to the PVCs, but **it will not remove existing labels**. The result is that a PVC might have labels that identify it as both a v4 and a v5 product, which can lead to unintended behavior.
103+
<br><br>
104+
To avoid that behavior, follow the instructions in the section on [removing legacy labels]({{< ref "guides/data-migration.md#removing-legacy-labels" >}}).
105+
{{% /notice %}}
106+
101107
2\. If you customized Postgres parameters, you will need to ensure they match in the PGO v5 cluster. For more information, please review the tutorial on [customizing a Postgres cluster]({{< relref "tutorial/customize-cluster.md" >}}).
102108

103109
3\. Once the `PostgresCluster` spec is populated according to these guidelines, you can create the `PostgresCluster` custom resource. For example, if the `PostgresCluster` you're creating is a modified version of the [`postgres` example](https://github.com/CrunchyData/postgres-operator-examples/tree/main/kustomize/postgres) in the [PGO examples repo](https://github.com/CrunchyData/postgres-operator-examples), you can run the following command:

docs/content/upgrade/v4tov5/upgrade-method-2-backups.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ kubectl apply -k examples/postgrescluster
132132

133133
If you wish to protect against this, first remove the reference to the pgBackRest PVC in the PostgresCluster spec:
134134

135-
136135
```
137136
kubectl patch postgrescluster hippo-pgbr-repo --type='json' -p='[{"op": "remove", "path": "/spec/dataSource/volumes"}]'
138137
```

0 commit comments

Comments
 (0)