Migrating from Docker to the IBM Container Registry
IBM has an anonymous registry and is migrating operator-related images from docker.io/ibmcom
to icr.io/cpopen
. The IBM® Operator Catalog and related images are now also available by way of IBM controlled sources for consumption.
You must consider two aspects of container migration to ensure that your cluster is migrated to the IBM source image repository:
- Your internet connected clusters that have installed the IBM Operator Catalog from
docker.io/ibmcom
must have their catalog sources updated - Your IBM software implements (or is updated to) an ImageContentSourcePolicy that has the cluster redirect from
docker.io/ibmcom
toicr.io/cpopen
Updating catalog source values
Internet connected clusters that have installed the IBM Operator Catalog from docker.io/ibmcom
must have their catalog source in ibm-operator-catalog
CatalogSource.yaml
file that is updated to reference
the new image location (icr.io/cpopen/ibm-operator-catalog:latest
). You can perform this update in three different ways:
Edit the YAML with the CLI
-
Enter the following command to edit the CatalogSource:
oc edit catalogsource ibm-operator-catalog -n openshift-marketplace
-
Navigate to the
spec
section of the YAML file, then update the image reference to beicr.io/cpopen/ibm-operator-catalog:latest
.spec: displayName: IBM Operator Catalog image: icr.io/cpopen/ibm-operator-catalog:latest publisher: IBM sourceType: grpc updateStrategy: registryPoll: interval: 45m
-
Save your edited CatalogSource YAML file. If the file is successfully edited and saved, the following message appears:
catalogsource.operators.coreos.com/ibm-operator-catalog edited
-
Restart the
ibm-operator-catalog
pod. Navigate to youropenshift-marketplace
project and enter the following command to ensure that the pod restarted:oc get catalogsource ibm-operator-catalog -n openshift-marketplace
Edit the YAML with the console
-
Click Home > Explore, then enter
catalogsource
as the filter value to locate your CatalogSource YAML file. -
Click CatalogSource, then click Instances and search for
ibm-operator-catalog
. -
Click the options menu (three vertical dots) and select Edit CatalogSource.
-
Scroll to the
spec
section of the YAML file and replacedocker.io/ibmcom
withicr.io/cpopen
, then click Save. -
Verify that CatalogSource has been implemented:
-
From the navigation bar, click Workloads > Pods.
-
Select
openshift-marketplace
in the Project drop-down menu. -
Enter
ibm-operator-catalog
in the search bar. -
Click
ibm-operator-catalog
link, then scroll to the Conditions to ensure that the CatalogSource has been updated.
-
Upgrade with a Helm chart
You can also upgrade the IBM Operator Helm chart from 1.0.0 to 1.1.0. This upgrade automatically changes the image reference from docker.io/ibmcom/ibm-operator-catalog:latest
to icr.io/cpopen/ibm-operator-catalog:latest
.
-
Log in to your console instance and select the
Developer
view. -
Click Add, then click From Catalog.
-
Enter the project and namespace where you want to install the Helm release.
-
Select Helm Charts and enter
operator
in the search bar. -
Click the Ibm Operator Catalog tile, then click Install Helm Chart.
-
Accept the license by entering
true
in thelicense
field. -
Click Install.
Note: The 1.1.0 version of the Helm chart gives you the option to Deploy Mirror Config. If that value is toggled to true
, it will also upgrade the ImageContentSourcePolicy (the next step and second consideration
of your migration from Docker to the IBM Container Registry).
Implementing ImageContentSourcePolicy to redirect to the IBM Container Registry
The second consideration is upgrading or implementing an ImageContentSourcePolicy to redirect you cluster from docker.io/ibmcom
to icr.io/cpopen
.
What is an ImageContentSourcePolicy?
The Red Hat OpenShift Container Platform ImageContentSourcePolicy resource updates the image pull process, allowing cluster level configuration of registry mirrors. After the mirror is added, for every image pull attempted by using a digest
from the source registry (docker.io/ibmcom
), the node attempts to pull from the mirror registry (icr.io/cpopen
). If the digest is not found, the cluster reverts to the source registry.
Creating or updating ImageContentSourcePolicy
You can create or update an ImageContentSourcePolicy by either of the following methods:
Creating a new ImageContentSourcePolicy
-
From the navigation bar, click Explore, then enter “imagecontentsourcepolicy” in the filter bar.
-
Click ImageContentSourcePolicy
-
Click Instances, then click Create ImageContentSourcePolicy.
-
Update the
name
andspec
section, then click Create.metadata: name: ibm-cpopen-mirror-config spec: repositoryDigestMirrors: - mirrors: - icr.io/cpopen source: docker.io/ibmcom
-
Verify that the ImageContentSourcePolicy has been created by clicking Details.
Updating an ImageContentSourcePolicy
-
From the navigation bar, click Explore, then enter “imagecontentsourcepolicy” in the filter bar.
-
Click ImageContentSourcePolicy
-
Click Instances, then select the ImageContentSourcePolicy that you want to update.
-
Click YAML to edit the source YAML. Update the
mirrors
section to include a mirror fromdocker.io/ibmcom
toicr.io/cpopen
. -
Click Save.
You have now migrated your images from Docker to the IBM Container Registry.