|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// migration_toolkit_for_containers/troubleshooting-mtc.adoc |
| 4 | +// migration_toolkit_for_containers/mtc-direct-migration-requirements.adoc |
| 5 | + |
| 6 | +:_mod-docs-content-type: CONCEPT |
| 7 | +[id="relabeling-selinux-workaround_{context}"] |
| 8 | += Applying the Skip SELinux relabel workaround with `spc_t` automatically on workloads running on {OCP} |
| 9 | + |
| 10 | +When attempting to migrate a namespace with {mtc-full} ({mtc-short}) and a substantial volume associated with it, the `rsync-server` may become frozen without any further information to troubleshoot the issue. |
| 11 | + |
| 12 | +[id="diagnosis-selinux-workaround_{context}"] |
| 13 | +== Diagnosing the need for the Skip SELinux relabel workaround |
| 14 | + |
| 15 | +Search for an error of `Unable to attach or mount volumes for pod...timed out waiting for the condition` in the kubelet logs from the node where the `rsync-server` for the Direct Volume Migration (DVM) runs. |
| 16 | + |
| 17 | +.Example kubelet log |
| 18 | +[source,yaml] |
| 19 | +---- |
| 20 | +kubenswrapper[3879]: W0326 16:30:36.749224 3879 volume_linux.go:49] Setting volume ownership for /var/lib/kubelet/pods/8905d88e-6531-4d65-9c2a-eff11dc7eb29/volumes/kubernetes.io~csi/pvc-287d1988-3fd9-4517-a0c7-22539acd31e6/mount and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699 |
| 21 | +
|
| 22 | +kubenswrapper[3879]: E0326 16:32:02.706363 3879 kubelet.go:1841] "Unable to attach or mount volumes for pod; skipping pod" err="unmounted volumes=[8db9d5b032dab17d4ea9495af12e085a], unattached volumes=[crane2-rsync-server-secret 8db9d5b032dab17d4ea9495af12e085a kube-api-access-dlbd2 crane2-stunnel-server-config crane2-stunnel-server-secret crane2-rsync-server-config]: timed out waiting for the condition" pod="caboodle-preprod/rsync-server" |
| 23 | +
|
| 24 | +kubenswrapper[3879]: E0326 16:32:02.706496 3879 pod_workers.go:965] "Error syncing pod, skipping" err="unmounted volumes=[8db9d5b032dab17d4ea9495af12e085a], unattached volumes=[crane2-rsync-server-secret 8db9d5b032dab17d4ea9495af12e085a kube-api-access-dlbd2 crane2-stunnel-server-config crane2-stunnel-server-secret crane2-rsync-server-config]: timed out waiting for the condition" pod="caboodle-preprod/rsync-server" podUID=8905d88e-6531-4d65-9c2a-eff11dc7eb29 |
| 25 | +---- |
| 26 | + |
| 27 | +[id="resolving-selinux-workaround_{context}"] |
| 28 | +== Resolving using the Skip SELinux relabel workaround |
| 29 | + |
| 30 | +To resolve this issue, set the `migration_rsync_super_privileged` parameter to `true` in both the source and destination `MigClusters` using the `MigrationController` custom resource (CR). |
| 31 | + |
| 32 | +.Example MigrationController CR |
| 33 | + |
| 34 | +[source,yaml] |
| 35 | +---- |
| 36 | +apiVersion: migration.openshift.io/v1alpha1 |
| 37 | +kind: MigrationController |
| 38 | +metadata: |
| 39 | + name: migration-controller |
| 40 | + namespace: openshift-migration |
| 41 | +spec: |
| 42 | + migration_rsync_super_privileged: true # <1> |
| 43 | + azure_resource_group: "" |
| 44 | + cluster_name: host |
| 45 | + mig_namespace_limit: "10" |
| 46 | + mig_pod_limit: "100" |
| 47 | + mig_pv_limit: "100" |
| 48 | + migration_controller: true |
| 49 | + migration_log_reader: true |
| 50 | + migration_ui: true |
| 51 | + migration_velero: true |
| 52 | + olm_managed: true |
| 53 | + restic_timeout: 1h |
| 54 | + version: 1.8.3 |
| 55 | +---- |
| 56 | + |
| 57 | +<1> The value of the `migration_rsync_super_privileged` parameter indicates whether or not to run Rsync Pods as _super privileged_ containers (`spc_t selinux context`). Valid settings are `true` or `false`. |
0 commit comments