Refer to the Reference to define a new major version of the FEPCluster custom resource. At this time, allow the running upgrade container to connect as you did in "6.5.1 Pre-work on the Data Source FEP Cluster".
In addition, a major version upgrade of FEP is performed by defining the "spec.fepChildCrVal.upgrade" field, as in the following example of defining a FEPCluster custom resource.
The upgrade execution container uses PV to store dump files retrieved from the FEPCluster of the data source.
If you have not enabled the automatic PV provisioning feature in your Kubernetes environment, create a PV for the upgrade in addition to the new PV for the FEPCluster before creating the FEPCluster custom resource.
Also, edit "spec.fepChildCrVal.customPgHba" to allow the connection of the upgrade execution container, as in "6.5.1 Pre-work on the Data Source FEP Cluster".
Example of Defining a FEPCluster Custom Resource to Perform an Upgrade:
apiVersion: fep.fujitsu.io/v2
kind: FEPCluster
metadata:
name: destination-fep
namespace: my-namespace
spec:
fep:
...
fepChildCrVal:
upgrade
sourceCluster: source-fep-cluster
storage:
size: 8Gi
customPgHba: |
host all all destination-fep-upgrade-pod.destination-fep-upgrade-headless-svc.my-namespace.svc.cluster.local trust
...
FEPCluster Custom Resource Fields "spec.fepChildCrVal.upgrade"
Field | Default | Details |
|---|---|---|
spec.fepChildCrVal.upgrade | Optional When this field is defined, a major version upgrade is performed. However, if spec.fepChildCrVal.restore is defined, the FEPCluster build stops. | |
spec.fepChildCrVal.upgrade.sourceCluster | Specify the FEPCluster CR name of the data migration source. Be sure to specify spec.fepChildCrVal.upgrade when defining it. | |
spec.fepChildCrVal.upgrade.mcSpec.limits | cpu: 200m memory: 300Mi | Optional Specify the maximum number of resources allocated to the upgrade execution container. |
spec.fepChildCrVal.upgrade.mcSpec.requests | cpu: 100m memory: 200Mi | Optional Specify the lower limit of resources allocated to the upgrade execution container. |
spec.fepChildCrVal.upgrade.image | Optional If omitted, the URL of the image is obtained from the operator container environment. | |
spec.fepChildCrVal.upgrade.imagePullPolicy | IfNotPresent | Optional Specify the pull policy for the container image.
|
spec.fepChildCrVal.upgrade.source.pgAdminTls.certificateName | Optional If the data source FEPCluster used "cert" as the authentication method for the Upgrade Execution Container, use the secret certificate that defines spec.fepChildCrVal.sysUsers.pgAdminTls.certificateName for the data source FEPCluster. If the above parameter is not defined, it points to the Kubernetes TLS secret containing the certificate of the Postgres user "postgres" in the data source. Refer to "4.8.2.1 Manual Certificate Management" for information about creating secrets. | |
spec.fepChildCrVal.upgrade.destination.pgAdminTls.certificateName | Optional If the newly created FEPCluster used the "cert" authentication method for the running upgrade container, use the secret certificate that defines the spec.fepChildCrVal.sysUsers.pgAdminTls.certificateName of the newly created FEPCluster. If the above parameter is not defined, it points to the Kubernetes TLS secret containing the certificate of the newly created Postgres user "postgres". Refer to "4.8.2.1 Manual Certificate Management" for information about creating secrets. | |
spec.fepChildCrVal.upgrade.storage | Optional Defines storage for storing dump files. | |
spec.fepChildCrVal.upgrade.storage.storageClass | Optional If omitted, the default storage class of the operating environment will be used. | |
spec.fepChildCrVal.upgrade.storage.size | 2Gi | Optional Specify the size of the storage to store the dump file. |
spec.fepChildCrVal.upgrade.storage.accessModes | ReadWriteOnce | Optional Storage access mode for storing dump files As an array of access modes. e.g. [ReadWriteMany] If omitted, it is treated as [ReadWriteOnce]. |
Note
Connect to the database and run the following SQL to check the size of the database in advance:
$ SELECT pg_size_pretty(sum(pg_database_size(datname))) AS dbsize FROM pg_database;
Since the pg_dumpall command used in the upgrade execution container outputs the database data as an SQL command, the file actually created is as follows.
For example, the integer type 2147483647 is 4 bytes for database data.
However, this is 10 bytes because SQL commands output them as strings. Therefore, make sure that the storage (PV) for dump files has sufficient disk space.
If you migrate your data to the new FEPCluster and the FEP major version upgrade is successful, the following event will be output:
$ kubectl get event
LAST SEEN TYPE REASON OBJECT MESSAGE
164m Normal SuccessfulFepUpgrade fepupgrade/<Name of the new FEPClusterCR> <namespace>, Successfully FEP UpgradeIn addition, the following annotation will be added to YAML in FEPClusterCR:
apiVersion: fep.fujitsu.io/v2
kind: FEPCluster
metadata:
annotations:
FEPUpgradeDone: true
...
name: destination-fep-cluster
namespace: my-namespace
spec:
...
Note
When a major upgrade of FEP fails, an event similar to the following is output:
$ kubectl get event
LAST SEEN TYPE REASON OBJECT MESSAGE
164m Warning FailedFepUpgrade fepupgrade/<Name of the new FEPClusterCR> <namespace>, Error/Failure in FEP UpgradeObtain the Kubernetes resource information listed in the OBJECT column, review the output messages, and then recreate the new FEPCluster custom resource.
$ kubectl describe fepupgrade/<Name of the new FEPClusterCR>