postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Upgrade Guide for 3.3.0 to 3.4.0 is inconsistent with actual deployments

Open sharkymcdongles opened this issue 7 years ago • 2 comments

Describe the bug Upgrade guide says this:

in 3.4, the pgbackup CRD includes a new field called BackupOpts, used to hold the pgbasebackup command options which can now be passed in on the CLI backup command, no changes to existing pgbackup CRD resources is required.

However when I check the crd.yaml it shows there is not such field added at all. Am I to read this to say that there is a new feature added, but it doesn't need to be defined in the CRDs? It's very vague as it stands.

sharkymcdongles avatar Jan 17 '19 16:01 sharkymcdongles

Hi,

the crd.yaml doesn't show the CRD fields but just the skeleton of the CRD, if you take a look at the CRD resources created:

kubectl get pgbackup somevalue -o json

you should see the various fields that are in each CRD resource being created. Here is an example from a 'pgo backup somecluster --backup-opts="--gzip --format=tar" ' command that shows the backupopts field being filled in:

{ "apiVersion": "cr.client-go.k8s.io/v1", "kind": "Pgbackup", "metadata": { "creationTimestamp": "2019-01-17T16:26:21Z", "generation": 1, "name": "withbouncer", "namespace": "demo", "resourceVersion": "124780", "selfLink": "/apis/cr.client-go.k8s.io/v1/namespaces/demo/pgbackups/withbouncer", "uid": "9fc262b5-1a74-11e9-8f9c-525400449a6b" }, "spec": { "backuphost": "withbouncer", "backupopts": "--gzip --format=tar", "backupport": "5432", "backuppvc": "", "backupstatus": "completed", "backupusersecret": "withbouncer-primaryuser-secret", "ccpimagetag": "rhel7-11.1-2.3.0-rc5", "name": "withbouncer", "storagespec": { "accessmode": "ReadWriteOnce", "fsgroup": "26", "matchLabels": "", "name": "withbouncer-backup", "size": "1G", "storageclass": "rook-ceph-block", "storagetype": "dynamic", "supplementalgroups": "" } }, "status": { "message": "Successfully processed Pgbackup by controller", "state": "Processed" } }

take a look at this file: postgres-operator/apis/cr/v1/backup.go

that file makes up the definition of the pgbackup CRD resource fields. Today, when you run a 'pgo backup' command, a pgbasebackup backup type, it will only keep a single CRD for a given cluster backup, if you run backups over and over, it will remove an existing CRD which keeps a status of the backup job. In the future this will change as we introduce backup mgmt.

When you upgrade the Operator, it will use the newest CRD definitions as found under apis/cr/v1 when it creates new CRD resources, older CRDs are left as-is in most cases.

hope that is helpful.

cheers.

jmccormick2001 avatar Jan 17 '19 16:01 jmccormick2001

closing as version 3.5.1 is out now, there were breaking changes in 3.5.0 so if you haven't upgraded yet here is a link to that https://crunchydata.github.io/postgres-operator/3.5.0/upgrade/

cahoonpwork avatar Feb 27 '19 15:02 cahoonpwork