1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/migration-installing-legacy-operator.adoc
2024-02-06 15:22:26 +00:00

142 lines
5.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * migrating_from_ocp_3_to_4/installing-3-4.adoc
// * migrating_from_ocp_3_to_4/installing-restricted-3-4.adoc
// * migration_toolkit_for_containers/installing-mtc.adoc
// * migration_toolkit_for_containers/installing-mtc-restricted.adoc
:_mod-docs-content-type: PROCEDURE
[id="migration-installing-legacy-operator_{context}"]
ifdef::installing-3-4,installing-restricted-3-4[]
= Installing the legacy {mtc-full} Operator on {product-title} 3
You can install the legacy {mtc-full} Operator manually on {product-title} 3.
endif::[]
ifdef::installing-mtc,installing-mtc-restricted[]
= Installing the legacy {mtc-full} Operator on {product-title} 4.2 to 4.5
You can install the legacy {mtc-full} Operator manually on {product-title} versions 4.2 to 4.5.
endif::[]
.Prerequisites
* You must be logged in as a user with `cluster-admin` privileges on all clusters.
* You must have access to `registry.redhat.io`.
* You must have `podman` installed.
ifdef::installing-3-4,installing-restricted-3-4[]
* You must create an link:https://access.redhat.com/solutions/3772061[image stream secret] and copy it to each node in the cluster.
endif::[]
ifdef::installing-restricted-3-4,installing-mtc-restricted[]
* You must have a Linux workstation with network access in order to download files from `registry.redhat.io`.
* You must create a mirror image of the Operator catalog.
* You must install the {mtc-full} Operator from the mirrored Operator catalog on {product-title} {product-version}.
endif::[]
.Procedure
. Log in to `registry.redhat.io` with your Red Hat Customer Portal credentials:
+
[source,terminal]
----
$ podman login registry.redhat.io
----
. Download the `operator.yml` file by entering the following command:
+
[source,terminal]
----
podman cp $(podman create registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/operator.yml ./
----
. Download the `controller.yml` file by entering the following command:
+
[source,terminal]
----
podman cp $(podman create registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/controller.yml ./
----
ifdef::installing-restricted-3-4,installing-mtc-restricted[]
. Obtain the Operator image mapping by running the following command:
+
[source,terminal,subs="attributes+"]
----
$ grep openshift-migration-legacy-rhel8-operator ./mapping.txt | grep rhmtc
----
+
The `mapping.txt` file was created when you mirrored the Operator catalog. The output shows the mapping between the `registry.redhat.io` image and your mirror registry image.
+
.Example output
[source,terminal]
----
registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a=<registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator
----
. Update the `image` values for the `ansible` and `operator` containers and the `REGISTRY` value in the `operator.yml` file:
+
[source,yaml]
----
containers:
- name: ansible
image: <registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a> <1>
...
- name: operator
image: <registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a> <1>
...
env:
- name: REGISTRY
value: <registry.apps.example.com> <2>
----
<1> Specify your mirror registry and the `sha256` value of the Operator image.
<2> Specify your mirror registry.
endif::[]
. Log in to your {product-title} source cluster.
ifdef::installing-3-4,installing-mtc[]
. Verify that the cluster can authenticate with `registry.redhat.io`:
+
[source,terminal]
----
$ oc run test --image registry.redhat.io/ubi9 --command sleep infinity
----
endif::[]
. Create the {mtc-full} Operator object:
+
[source,terminal]
----
$ oc create -f operator.yml
----
+
.Example output
[source,terminal]
----
namespace/openshift-migration created
rolebinding.rbac.authorization.k8s.io/system:deployers created
serviceaccount/migration-operator created
customresourcedefinition.apiextensions.k8s.io/migrationcontrollers.migration.openshift.io created
role.rbac.authorization.k8s.io/migration-operator created
rolebinding.rbac.authorization.k8s.io/migration-operator created
clusterrolebinding.rbac.authorization.k8s.io/migration-operator created
deployment.apps/migration-operator created
Error from server (AlreadyExists): error when creating "./operator.yml":
rolebindings.rbac.authorization.k8s.io "system:image-builders" already exists <1>
Error from server (AlreadyExists): error when creating "./operator.yml":
rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists
----
<1> You can ignore `Error from server (AlreadyExists)` messages. They are caused by the {mtc-full} Operator creating resources for earlier versions of {product-title} 4 that are provided in later releases.
. Create the `MigrationController` object:
+
[source,terminal]
----
$ oc create -f controller.yml
----
. Verify that the {mtc-short} pods are running:
+
[source,terminal]
----
$ oc get pods -n openshift-migration
----