spec:
...
migration_controller: false
migration_ui: false
...
deprecated_cors_configuration: true
You can install the Migration Toolkit for Containers Operator on your OpenShift Container Platform 4.6 target cluster and 4.1 source cluster. The Migration Toolkit for Containers Operator installs the Migration Toolkit for Containers (MTC) on the target cluster by default.
Optional: You can configure the Migration Toolkit for Containers Operator to install the MTC on an OpenShift Container Platform 3 cluster or on a remote cluster. |
In a restricted environment, you can install the Migration Toolkit for Containers Operator from a local mirror registry.
After you have installed the Migration Toolkit for Containers Operator on your clusters, you can launch the MTC web console.
You can install the Migration Toolkit for Containers Operator with the Operator Lifecycle Manager on an OpenShift Container Platform 4.6 target cluster and on an OpenShift Container Platform 4.1 source cluster.
You can install the Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 4.6 target cluster by using Operator Lifecycle Manager (OLM) to install the Migration Toolkit for Containers Operator.
MTC is installed on the target cluster by default.
In the OpenShift Container Platform web console, click Operators → OperatorHub.
Use the Filter by keyword field to find the Migration Toolkit for Containers Operator.
Select the Migration Toolkit for Containers Operator and click Install.
In the Subscription tab, change the Approval option to Automatic.
Click Install.
On the Installed Operators page, the Migration Toolkit for Containers Operator appears in the openshift-migration project with the status Succeeded.
Click Migration Toolkit for Containers Operator.
Under Provided APIs, locate the Migration Controller tile, and click Create Instance.
Click Create.
Click Workloads → Pods to verify that the MTC pods are running.
You can install the Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 4 source cluster by using Operator Lifecycle Manager (OLM) to install the Migration Toolkit for Containers Operator.
In the OpenShift Container Platform web console, click Catalog → OperatorHub.
Use the Filter by keyword field to find the Migration Toolkit for Containers Operator.
Select the Migration Toolkit for Containers Operator and click Install.
Click Install.
On the Installed Operators page, the Migration Toolkit for Containers Operator appears in the openshift-migration project with the status Succeeded.
Click Migration Toolkit for Containers Operator.
Under Provided APIs, locate the Migration Controller tile, and click Create Instance.
Update the migration_controller
and migration_ui
parameters and add the deprecated_cors_configuration
parameter to the manifest:
spec:
...
migration_controller: false
migration_ui: false
...
deprecated_cors_configuration: true
Click Create.
Click Workloads → Pods to verify that the MTC pods are running.
You can build a custom Operator catalog image for OpenShift Container Platform 4, push it to a local mirror image registry, and configure the Operator Lifecycle Manager to install the Migration Toolkit for Containers Operator from the local registry.
If you want to prune the default catalog and selectively mirror only a subset of Operators, install the opm
CLI.
Operator catalogs that source content provided by Red Hat and community projects are configured for OperatorHub by default during an OpenShift Container Platform installation. Before configuring OperatorHub to instead use local catalog sources in a restricted network environment, you must disable the default catalogs.
Disable the sources for the default catalogs by adding disableAllDefaultSources: true
to the OperatorHub
object:
$ oc patch OperatorHub cluster --type json \
-p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
An index image, based on the Operator Bundle Format, is a containerized snapshot of an Operator catalog. You can prune an index of all but a specified list of packages, creating a copy of the source index containing only the Operators that you want.
When configuring Operator Lifecycle Manager (OLM) to use mirrored content on restricted network OpenShift Container Platform clusters, use this pruning method if you want to only mirror a subset of Operators from the default catalogs.
For the steps in this procedure, the target registry is an existing mirror registry that is accessible by both your cluster and a workstation with unrestricted network access. This example also shows pruning the index image for the default redhat-operators
catalog, but the process is the same for all index images.
Workstation with unrestricted network access
podman
version 1.9.3+
opm
version 1.12.3+
Access to a registry that supports Docker v2-2
Authenticate with registry.redhat.io
:
$ podman login registry.redhat.io
Authenticate with your target registry:
$ podman login <target_registry>
Determine the list of packages you want to include in your pruned index.
Run the source index image that you want to prune in a container. For example:
$ podman run -p50051:50051 \
-it registry.redhat.io/redhat/redhat-operator-index:v4.6
Trying to pull registry.redhat.io/redhat/redhat-operator-index:v4.6...
Getting image source signatures
Copying blob ae8a0c23f5b1 done
...
INFO[0000] serving registry database=/database/index.db port=50051
In a separate terminal session, use the grpcurl
command to get a list of the packages provided by the index:
$ grpcurl -plaintext localhost:50051 api.Registry/ListPackages > packages.out
Inspect the packages.out
file and identify which package names from this list you want to keep in your pruned index. For example:
...
{
"name": "advanced-cluster-management"
}
...
{
"name": "jaeger-product"
}
...
{
{
"name": "quay-operator"
}
...
In the terminal session where you executed the podman run
command, press Ctrl and C to stop the container process.
Run the following command to prune the source index of all but the specified packages:
$ opm index prune \
-f registry.redhat.io/redhat/redhat-operator-index:v4.6 \(1)
-p advanced-cluster-management,jaeger-product,quay-operator \(2)
-t <target_registry>:<port>/<namespace>/redhat-operator-index:v4.6 \(3)
-i registry.redhat.io/openshift4/ose-operator-registry/redhat-operator-index:v4.6 (4)
1 | Index to prune. |
2 | Comma-separated list of packages to keep. |
3 | Custom tag for new index image being built. |
4 | For IBM Power Systems and IBM Z images only, you must add the -i entry to the command. |
Run the following command to push the new index image to your target registry:
$ podman push <target_registry>:<port>/<namespace>/redhat-operator-index:v4.6
where <namespace>
is any existing namespace on the registry.
For example, you might create an olm-mirror
namespace to push all mirrored content to.
You can mirror the Operator content of a Red Hat-provided catalog, or a custom catalog, into a container image registry using the oc adm catalog mirror
command. The target registry must support Docker v2-2. For a cluster on a restricted network, this registry can be one that the cluster has network access to, such as a mirror registry created during a restricted network cluster installation.
The oc adm catalog mirror
command also automatically mirrors the index image that is specified during the mirroring process, whether it be a Red Hat-provided index image or your own custom-built index image, to the target registry. You can then use the mirrored index image to create a catalog source that allows Operator Lifecycle Manager (OLM) to load the mirrored catalog onto your OpenShift Container Platform cluster.
For the steps in this procedure, the target registry is an existing mirror registry that is accessible by both your cluster and a workstation with unrestricted network access.
Workstation with unrestricted network access
podman
version 1.9.3+
Access to mirror registry that supports Docker v2-2
If you are working with private registries, set the REG_CREDS
environment variable to the file path of your registry credentials for use in later steps. For example, for the podman
CLI:
$ REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
On your workstation with unrestricted network access, use the podman login
command to authenticate with the target mirror registry:
$ podman login <mirror_registry>
Authenticate with registry.redhat.io
:
$ podman login registry.redhat.io
The oc adm catalog mirror
command extracts the contents of an index image to generate the manifests required for mirroring. You can choose either of the following:
Allow the default behavior of the command to automatically mirror all of the image content from the index image, as well as the index image itself, to your mirror registry after generating manifests.
Add the --manifests-only
flag to only generate the manifests required for mirroring, but do not actually mirror the image content to the registry yet. This can be useful for reviewing what will be mirrored, and it allows you to make any changes to the mapping list if you only require a subset of packages. You can then use that file with the oc image mirror
command to mirror the modified list of images in a later step.
The |
On your workstation with unrestricted network access, run the following command:
$ oc adm catalog mirror \
<index_image> \(1)
<mirror_registry>:<port> \(2)
[-a ${REG_CREDS}] \(3)
[--insecure] \(4)
[--index-filter-by-os='<platform>/<arch>'] \(5)
[--manifests-only] (6)
1 | Specify the index image for the catalog you want to mirror. For example, this might be a pruned index image that you created previously, or one of the source index images for the default catalogs, such as registry.redhat.io/redhat/redhat-operator-index:v4.6 . |
2 | Specify the target registry to mirror the Operator content to. |
3 | Optional: If required, specify the location of your registry credentials file. |
4 | Optional: If you do not want to configure trust for the target registry, add the --insecure flag. |
5 | Optional: Specify which platform and architecture of the index image to select when multiple variants are available. Images are passed as '<platform>/<arch>[/<variant>]' . This does not apply to images referenced by the index. Valid values are linux/amd64 , linux/ppc64le , and linux/s390x . |
6 | Optional: Only generate the manifests required for mirroring and do not actually mirror the image content to a registry. |
src image has index label for database path: /database/index.db
using database path mapping: /database/index.db:/tmp/153048078
wrote database to /tmp/153048078 (1)
...
wrote mirroring manifests to manifests-redhat-operator-index-1614211642
1 | Directory for the temporary index.db database generated by the command. |
After running the command, a manifests-<index_image_name>-<random_number>/
directory is created in the current directory and generates the following files:
The catalogSource.yaml
file is a basic definition for a CatalogSource
object that is pre-populated with your index image tag and other relevant metadata. This file can be used as is or modified to add the catalog source to your cluster.
The imageContentSourcePolicy.yaml
file defines an ImageContentSourcePolicy
object that can configure nodes to translate between the image references stored in Operator manifests and the mirrored registry.
The mapping.txt
file contains all of the source images and where to map them in the target registry. This file is compatible with the oc image mirror
command and can be used to further customize the mirroring configuration.
If you used the |
Create the ImageContentSourcePolicy
object:
$ oc create -f ./manifests-redhat-operator-index-<random_number>/imageContentSourcePolicy.yaml
You can now create a CatalogSource
object to reference your mirrored index image and Operator content.
You can create an Operator catalog from an index image and apply it to an OpenShift Container Platform cluster for use with Operator Lifecycle Manager (OLM).
An index image built and pushed to a registry.
Create a CatalogSource
object that references your index image.
Modify the following to your specifications and save it as a catalogSource.yaml
file:
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: my-operator-catalog
namespace: openshift-marketplace
spec:
sourceType: grpc
image: <mirror_registry>:<port>/<namespace>/redhat-operator-index:v4.6 (1)
displayName: My Operator Catalog
publisher: <publisher_name> (2)
updateStrategy:
registryPoll: (3)
interval: 30m
1 | Specify your index image. |
2 | Specify your name or an organization name publishing the catalog. |
3 | Catalog sources can automatically check for new versions to keep up to date. |
Use the file to create the CatalogSource
object:
$ oc apply -f catalogSource.yaml
Verify the following resources are created successfully.
Check the pods:
$ oc get pods -n openshift-marketplace
NAME READY STATUS RESTARTS AGE
my-operator-catalog-6njx6 1/1 Running 0 28s
marketplace-operator-d9f549946-96sgr 1/1 Running 0 26h
Check the catalog source:
$ oc get catalogsource -n openshift-marketplace
NAME DISPLAY TYPE PUBLISHER AGE
my-operator-catalog My Operator Catalog grpc 5s
Check the package manifest:
$ oc get packagemanifest -n openshift-marketplace
NAME CATALOG AGE
jaeger-product My Operator Catalog 93s
You can now install the Operators from the OperatorHub page on your OpenShift Container Platform web console.
You can install the Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 4.6 target cluster by using Operator Lifecycle Manager (OLM) to install the Migration Toolkit for Containers Operator.
MTC is installed on the target cluster by default.
You have created a custom Operator catalog and pushed it to a mirror registry.
You have configured OLM to install the Migration Toolkit for Containers Operator from the mirror registry.
In the OpenShift Container Platform web console, click Operators → OperatorHub.
Use the Filter by keyword field to find the Migration Toolkit for Containers Operator.
Select the Migration Toolkit for Containers Operator and click Install.
Click Install.
On the Installed Operators page, the Migration Toolkit for Containers Operator appears in the openshift-migration project with the status Succeeded.
Click Migration Toolkit for Containers Operator.
Under Provided APIs, locate the Migration Controller tile, and click Create Instance.
Click Create.
Click Workloads → Pods to verify that the MTC pods are running.
You can install the Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 4 source cluster by using Operator Lifecycle Manager (OLM) to install the Migration Toolkit for Containers Operator.
You have created a custom Operator catalog and pushed it to a mirror registry.
You have configured OLM to install the Migration Toolkit for Containers Operator from the mirror registry.
Use the Filter by keyword field to find the Migration Toolkit for Containers Operator.
Select the Migration Toolkit for Containers Operator and click Install.
Click Install.
On the Installed Operators page, the Migration Toolkit for Containers Operator appears in the openshift-migration project with the status Succeeded.
Click Migration Toolkit for Containers Operator.
Under Provided APIs, locate the Migration Controller tile, and click Create Instance.
Click Create.
Click Workloads → Pods to verify that the MTC pods are running.
You can launch the Migration Toolkit for Containers (MTC) web console in a browser.
Log in to the OpenShift Container Platform cluster on which you have installed MTC.
Obtain the MTC web console URL by entering the following command:
$ oc get -n openshift-migration route/migration -o go-template='https://{{ .spec.host }}'
The output resembles the following: https://migration-openshift-migration.apps.cluster.openshift.com
.
Launch a browser and navigate to the MTC web console.
If you try to access the MTC web console immediately after installing the Migration Toolkit for Containers Operator, the console might not load because the Operator is still configuring the cluster. Wait a few minutes and retry. |
If you are using self-signed CA certificates, you will be prompted to accept the CA certificate of the source cluster API server. The web page guides you through the process of accepting the remaining certificates.
Log in with your OpenShift Container Platform username and password.