You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/migration-kubernetes-objects.adoc
+48-6Lines changed: 48 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,16 @@
5
5
6
6
:_content-type: PROCEDURE
7
7
[id="migration-kubernetes-objects_{context}"]
8
-
= Migrating Kubernetes objects
8
+
= Performing a state migration of Kubernetes objects by using the {mtc-short} API
9
9
10
-
You can perform a one-time migration of Kubernetes objects that constitute an application's state.
10
+
After you migrate all the PV data, you can use the Migration Toolkit for Containers (MTC) API to perform a one-time state migration of Kubernetes objects that constitute an application.
11
+
12
+
You do this by configuring `MigPlan` custom resource (CR) fields to provide a list of Kubernetes resources with an additional label selector to further filter those resources, and then performing a migration by creating a `MigMigration` CR. The `MigPlan` resource is closed after the migration.
13
+
14
+
[NOTE]
15
+
====
16
+
Selecting Kubernetes resources is an API-only feature. You must update the `MigPlan` CR and create a `MigMigration` CR for it by using the CLI. The {mtc-short} web console does not support migrating Kubernetes objects.
17
+
====
11
18
12
19
[NOTE]
13
20
====
@@ -16,13 +23,32 @@ After migration, the `closed` parameter of the `MigPlan` CR is set to `true`. Yo
16
23
17
24
You add Kubernetes objects to the `MigPlan` CR by using one of the following options:
18
25
19
-
* Adding the Kubernetes objects to the `includedResources` section.
20
-
* Using the `labelSelector` parameter to reference labeled Kubernetes objects.
21
-
* 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`.
26
+
* Adding the Kubernetes objects to the `includedResources` section. When the `includedResources` field is specified in the `MigPlan` CR, the plan takes a list of `group-kind` as input. Only resources present in the list are included in the migration.
27
+
* Adding the optional `labelSelector` parameter to filter the `includedResources` in the `MigPlan`. When this field is specified, only resources matching the label selector are included in the migration. For example, you can filter a list of `Secret` and `ConfigMap` resources by using the label `app: frontend` as a filter.
22
28
23
29
.Procedure
24
30
25
-
* Update the `MigPlan` CR:
31
+
. Update the `MigPlan` CR to include Kubernetes resources and, optionally, to filter the included resources by adding the `labelSelector` parameter:
32
+
33
+
.. To update the `MigPlan` CR to include Kubernetes resources:
34
+
+
35
+
[source,yaml]
36
+
----
37
+
apiVersion: migration.openshift.io/v1alpha1
38
+
kind: MigPlan
39
+
metadata:
40
+
name: <migplan>
41
+
namespace: openshift-migration
42
+
spec:
43
+
includedResources:
44
+
- kind: <kind> <1>
45
+
group: ""
46
+
- kind: <kind>
47
+
group: ""
48
+
----
49
+
<1> Specify the Kubernetes object, for example, `Secret` or `ConfigMap`.
50
+
51
+
.. Optional: To filter the included resources by adding the `labelSelector` parameter:
26
52
+
27
53
[source,yaml]
28
54
----
@@ -44,3 +70,19 @@ spec:
44
70
----
45
71
<1> Specify the Kubernetes object, for example, `Secret` or `ConfigMap`.
46
72
<2> Specify the label of the resources to migrate, for example, `app: frontend`.
73
+
74
+
. Create a `MigMigration` CR to migrate the selected Kubernetes resources. Verify that the correct `MigPlan` is referenced in `migPlanRef`:
0 commit comments