From 6f3da8f1a144fbb5bb3877102c48566e859fb519 Mon Sep 17 00:00:00 2001 From: Avital Pinnick Date: Wed, 30 Jun 2021 14:37:52 +0300 Subject: [PATCH] MIG-747: Cached clients --- .../advanced-migration-options-3-4.adoc | 1 + .../advanced-migration-options-mtc.adoc | 1 + ...on-enabling-cached-kubernetes-clients.adoc | 44 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 modules/migration-enabling-cached-kubernetes-clients.adoc diff --git a/migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc b/migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc index ffa28792f4e0..5f4f2e08892f 100644 --- a/migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc +++ b/migrating_from_ocp_3_to_4/advanced-migration-options-3-4.adoc @@ -43,5 +43,6 @@ include::modules/migration-writing-ansible-playbook-hook.adoc[leveloffset=+2] include::modules/migration-changing-migration-plan-limits.adoc[leveloffset=+1] include::modules/migration-excluding-resources.adoc[leveloffset=+1] include::modules/migration-enabling-pv-resizing-dvm.adoc[leveloffset=+1] +include::modules/migration-enabling-cached-kubernetes-clients.adoc[leveloffset=+1] :advanced-migration-options-3-4!: diff --git a/migration-toolkit-for-containers/advanced-migration-options-mtc.adoc b/migration-toolkit-for-containers/advanced-migration-options-mtc.adoc index 7b1a165a4925..522b5bb122ac 100644 --- a/migration-toolkit-for-containers/advanced-migration-options-mtc.adoc +++ b/migration-toolkit-for-containers/advanced-migration-options-mtc.adoc @@ -42,3 +42,4 @@ include::modules/migration-writing-ansible-playbook-hook.adoc[leveloffset=+2] include::modules/migration-changing-migration-plan-limits.adoc[leveloffset=+1] include::modules/migration-excluding-resources.adoc[leveloffset=+1] include::modules/migration-enabling-pv-resizing-dvm.adoc[leveloffset=+1] +include::modules/migration-enabling-cached-kubernetes-clients.adoc[leveloffset=+1] diff --git a/modules/migration-enabling-cached-kubernetes-clients.adoc b/modules/migration-enabling-cached-kubernetes-clients.adoc new file mode 100644 index 000000000000..a8094df77c2a --- /dev/null +++ b/modules/migration-enabling-cached-kubernetes-clients.adoc @@ -0,0 +1,44 @@ +// 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-enabling-cached-kubernetes-clients_{context}"] += Enabling cached Kubernetes clients + +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. + +[NOTE] +==== +Delegated tasks, for example, Rsync backup for direct volume migration or Velero backup and restore, however, do not show improved performance with cached clients. +==== + +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. + +You can increase the memory limits and requests of the `MigrationController` CR if `OOMKilled` errors occur after you enable cached clients. + +.Procedure + +. Enable cached clients by running the following command: ++ +[source,terminal] +---- +$ oc -n openshift-migration patch migrationcontroller migration-controller --type=json --patch \ + '[{ "op": "replace", "path": "/spec/mig_controller_enable_cache", "value": true}]' +---- + +. Optional: Increase the `MigrationController` CR memory limits by running the following command: ++ +[source,terminal] +---- +$ oc -n openshift-migration patch migrationcontroller migration-controller --type=json --patch \ + '[{ "op": "replace", "path": "/spec/mig_controller_limits_memory", "value": <10Gi>}]' +---- + +. Optional: Increase the `MigrationController` CR memory requests by running the following command: ++ +[source,terminal] +---- +$ oc -n openshift-migration patch migrationcontroller migration-controller --type=json --patch \ + '[{ "op": "replace", "path": "/spec/mig_controller_requests_memory", "value": <350Mi>}]' +----