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.
Important: If you operate in an
internet-connected Red Hat® OpenShift® Container Platform cluster,
you must update your image references from Docker to the IBM
Container Registry. IBM Operator Catalog related images can be
sourced from icr.io/cpopen.
You must consider two aspects of container migration to ensure that your cluster is migrated to the IBM source image repository:
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
specsection 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-catalogpod. Navigate to youropenshift-marketplaceproject 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
Important: Make sure you have the role of Administrator before editing the CatalogSource.
-
Click Home > Explore, then enter
catalogsourceas 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
specsection of the YAML file and replacedocker.io/ibmcomwithicr.io/cpopen, then click Save.
-
Verify that CatalogSource has been implemented:
- From the navigation bar, click Workloads > Pods.
- Select
openshift-marketplacein the Project drop-down menu. - Enter
ibm-operator-catalogin the search bar. -
Click
ibm-operator-cataloglink, 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
Developerview.
-
Click Add, then click From Catalog.
-
Enter the project and namespace where you want to install the Helm release.
-
Select Helm Charts and enter
operatorin the search bar.
-
Click the Ibm Operator Catalog tile, then click Install Helm Chart.
-
Accept the license by entering
truein thelicensefield.
-
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.
Important: An ImageContentSourcePolicy is implemented by changing the configuration of the cluster nodes. For Red Hat OpenShift Container Platform 4.6 and earlier, all of the worker nodes restart one at a time after implementation. From Red Hat OpenShift Container Platform 4.7 and later, worker nodes are drained, one at a time, without restarting the node. During this process, pods are rescheduled on to alternative nodes. You must ensure that your cluster has sufficient capacity.
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
nameandspecsection, 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
mirrorssection to include a mirror fromdocker.io/ibmcomtoicr.io/cpopen.
-
Click Save.
You have now migrated your images from Docker to the IBM Container Registry.