|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc |
| 4 | +// * migration-toolkit-for-containers/advanced-migration-options-mtc.adoc |
| 5 | + |
| 6 | +[id="migration-enabling-cached-kubernetes-clients_{context}"] |
| 7 | += Enabling cached Kubernetes clients |
| 8 | + |
| 9 | +You can enable cached Kubernetes clients in the `MigrationController` custom resource (CR) for improved performance during migration. The greatest performance benefit is displayed when migrating between clusters in different regions or with significant network latency. |
| 10 | + |
| 11 | +[NOTE] |
| 12 | +==== |
| 13 | +Delegated tasks, for example, Rsync backup for direct volume migration or Velero backup and restore, however, do not show improved performance with cached clients. |
| 14 | +==== |
| 15 | + |
| 16 | +Cached clients require extra memory because the `MigrationController` CR caches all API resources that are required for interacting with `MigCluster` CRs. Requests that are normally sent to the API server are directed to the cache instead. The cache watches the API server for updates. |
| 17 | + |
| 18 | +You can increase the memory limits and requests of the `MigrationController` CR if `OOMKilled` errors occur after you enable cached clients. |
| 19 | + |
| 20 | +.Procedure |
| 21 | + |
| 22 | +. Enable cached clients by running the following command: |
| 23 | ++ |
| 24 | +[source,terminal] |
| 25 | +---- |
| 26 | +$ oc -n openshift-migration patch migrationcontroller migration-controller --type=json --patch \ |
| 27 | + '[{ "op": "replace", "path": "/spec/mig_controller_enable_cache", "value": true}]' |
| 28 | +---- |
| 29 | + |
| 30 | +. Optional: Increase the `MigrationController` CR memory limits by running the following command: |
| 31 | ++ |
| 32 | +[source,terminal] |
| 33 | +---- |
| 34 | +$ oc -n openshift-migration patch migrationcontroller migration-controller --type=json --patch \ |
| 35 | + '[{ "op": "replace", "path": "/spec/mig_controller_limits_memory", "value": <10Gi>}]' |
| 36 | +---- |
| 37 | + |
| 38 | +. Optional: Increase the `MigrationController` CR memory requests by running the following command: |
| 39 | ++ |
| 40 | +[source,terminal] |
| 41 | +---- |
| 42 | +$ oc -n openshift-migration patch migrationcontroller migration-controller --type=json --patch \ |
| 43 | + '[{ "op": "replace", "path": "/spec/mig_controller_requests_memory", "value": <350Mi>}]' |
| 44 | +---- |
0 commit comments