-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BZ2015590: Fixing and reorganizing state migration
- Loading branch information
Showing
9 changed files
with
132 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc | ||
// * migration_toolkit_for_containers/advanced-migration-options-mtc.adoc | ||
|
||
[id="migration-excluding-pvcs_{context}"] | ||
= Excluding persistent volume claims | ||
|
||
You select persistent volume claims (PVCs) for state migration by excluding the PVCs that you do not want to migrate. You exclude PVCs by setting the `spec.persistentVolumes.pvc.selection.action` parameter of the `MigPlan` custom resource (CR) after the persistent volumes (PVs) have been discovered. | ||
|
||
.Prerequisites | ||
|
||
* `MigPlan` CR with discovered PVs. | ||
|
||
.Procedure | ||
|
||
* Add the `spec.persistentVolumes.pvc.selection.action` parameter to the `MigPlan` CR and set it to `skip`: | ||
+ | ||
[source,yaml] | ||
---- | ||
apiVersion: migration.openshift.io/v1alpha1 | ||
kind: MigPlan | ||
metadata: | ||
name: <migplan> | ||
namespace: openshift-migration | ||
spec: | ||
... | ||
persistentVolumes: | ||
- capacity: 10Gi | ||
name: <pv_name> | ||
pvc: | ||
... | ||
selection: | ||
action: skip | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc | ||
// * migration_toolkit_for_containers/advanced-migration-options-mtc.adoc | ||
|
||
[id="migration-kubernetes-objects_{context}"] | ||
= Migrating Kubernetes objects | ||
|
||
You can perform a one-time migration of Kubernetes objects that constitute an application's state. | ||
|
||
[NOTE] | ||
==== | ||
After migration, the `closed` parameter of the `MigPlan` CR is set to `true`. You cannot create another `MigMigration` CR for this `MigPlan` CR. | ||
==== | ||
|
||
You add Kubernetes objects to the `MigPlan` CR by using one of the following options: | ||
|
||
* Adding the Kubernetes objects to the `includedResources` section. | ||
* Using the `labelSelector` parameter to reference labeled Kubernetes objects. | ||
* Adding Kubernetes objects to the `includedResources` section and then filtering them with the `labelSelector` parameter, for example, `Secret` and `ConfigMap` resources with the label `app: frontend`. | ||
|
||
.Procedure | ||
|
||
* Update the `MigPlan` CR: | ||
+ | ||
[source,yaml] | ||
---- | ||
apiVersion: migration.openshift.io/v1alpha1 | ||
kind: MigPlan | ||
metadata: | ||
name: <migplan> | ||
namespace: openshift-migration | ||
spec: | ||
includedResources: <1> | ||
- kind: <Secret> | ||
group: "" | ||
- kind: <ConfigMap> | ||
group: "" | ||
... | ||
labelSelector: | ||
matchLabels: | ||
<app: frontend> <2> | ||
---- | ||
<1> Specify the `kind` and `group` of each resource. | ||
<2> Specify the label of the resources to migrate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc | ||
// * migration_toolkit_for_containers/advanced-migration-options-mtc.adoc | ||
|
||
[id="migration-mapping-pvcs_{context}"] | ||
= Mapping persistent volume claims | ||
|
||
You can migrate PV data from the source cluster to PVCs that are already provisioned in the target cluster by mapping PVCs in the `MigPlan` CR. This ensures that the target PVCs of migrated applications are synchronized with the source PVCs. | ||
|
||
You map persistent volume claims (PVCs) by updating the `spec.persistentVolumes.pvc.name` parameter in the `MigPlan` custom resource (CR) after the persistent volumes (PVs) have been discovered. | ||
|
||
.Prerequisites | ||
|
||
* `MigPlan` CR with discovered PVs. | ||
|
||
.Procedure | ||
|
||
* Update the `spec.persistentVolumes.pvc.name` parameter in the `MigPlan` CR: | ||
+ | ||
[source,yaml] | ||
---- | ||
apiVersion: migration.openshift.io/v1alpha1 | ||
kind: MigPlan | ||
metadata: | ||
name: <migplan> | ||
namespace: openshift-migration | ||
spec: | ||
... | ||
persistentVolumes: | ||
- capacity: 10Gi | ||
name: <pv_name> | ||
pvc: | ||
name: <source_pvc>:<destination_pvc> <1> | ||
---- | ||
<1> Specify the PVC on the source cluster and the PVC on the destination cluster. If the destination PVC does not exist, it will be created. You can use this mapping to change the PVC name during migration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters