Configuring an image content source policy for IBM Software Hub software images

If you mirror images to a private container registry, you must tell your cluster where to find the software images by creating an image content source policy or image digest mirror set.

Installation phase
  • You are not here. Setting up a client workstation
  • You are not here. Setting up a cluster
  • You are not here. Collecting required information
  • You are not here. Preparing to run installs in a restricted network
  • You are here icon. Preparing to run installs from a private container registry
  • You are not here. Preparing the cluster for IBM Software Hub
  • You are not here. Preparing to install an instance of IBM Software Hub
  • You are not here. Installing an instance of IBM Software Hub
  • You are not here. Setting up the control plane
  • You are not here. Installing solutions and services
Who needs to complete this task?
Cluster administrator A cluster administrator must complete this task.
When do you need to complete this task?
One-time setup If you mirrored the IBM Software Hub software images to a private container registry, you must complete this task before you can install IBM Software Hub.

Before you begin

Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

If your cluster is running Red Hat® OpenShift® Container Platform Version 4.14 or later, check for existing image content source policies before you complete this task:

  1. Run the following command to get the list of image content source policy resources:
    oc get imageContentSourcePolicy
    • If the command returns No resources found, proceed to About this task.
    • If the command returns a list of image content source policies, complete Converting ImageContentSourcePolicy (ICSP) files for image registry repository mirroring in the Red Hat OpenShift Container Platform documentation:

About this task

Important: This process will temporarily disable scheduling on each node in the cluster, so you might notice that resources are temporarily unavailable. However, this process happens on one node at a time. The cluster will temporarily disable scheduling on a node, apply the configuration change, and then re-enable scheduling before starting the process on the next node.

Use the cpd-cli manage apply-icsp command to create or update the image content source policy or image digest mirror set for the IBM Software Hub images.

The type of resource that the command creates depends on the version of Red Hat OpenShift Container Platform that you are running:
  • On Version 4.12, the cpd-cli automatically creates an image content source policy.
  • On Version 4.14 and later, the cpd-cli automatically creates an image digest mirror set.

Procedure

  1. Log the cpd-cli in to the Red Hat OpenShift Container Platform cluster:
    ${CPDM_OC_LOGIN}
    Remember: CPDM_OC_LOGIN is an alias for the cpd-cli manage login-to-ocp command.
  2. Create or update the required image content source policy or image digest mirror set:
    cpd-cli manage apply-icsp \
    --registry=${PRIVATE_REGISTRY_LOCATION}
  3. Get the status of the nodes:
    oc get nodes

    Wait until all the nodes are Ready before you proceed to the next step. For example, if you see Ready,SchedulingDisabled, wait for the process to complete:

    NAME                           STATUS                     ROLES    AGE     VERSION
    master0                        Ready                      master   5h57m   v1.20.0
    master1                        Ready                      master   5h57m   v1.20.0
    master2                        Ready                      master   5h57m   v1.20.0
    worker0                        Ready,SchedulingDisabled   worker   5h48m   v1.20.0
    worker1                        Ready                      worker   5h48m   v1.20.0
    worker2                        Ready                      worker   5h48m   v1.20.0
    Tip: You can use the watch oc get nodes command to monitor the status of the nodes. The command provides an update every 2 seconds. When all of the nodes return Ready you can exit the command by pressing Ctrl+C.

    Alternatively, if you find that the oc get nodes command returns Ready prematurely, you can use the oc get mcp command to get the real-time status of the nodes.

Results

  • On Version 4.12, the cpd-cli manage apply-icsp command creates the required an image content source policy.
  • On Version 4.14 and later, the cpd-cli manage apply-icsp command creates the required image digest mirror set.
Important: Do not modify the image content source policy or image digest mirror set that is created by the cpd-cli manage apply-icsp command.

If you are installing IBM Software Hub on Red Hat OpenShift Service on AWS (ROSA), changing the image content source policy or image digest mirror set could result in Red Hat violations that could lead to limited support from Red Hat. For details, see Red Hat Online Services Product Appendix 4.

What to do next

Now that you've created the image content source policy or image digest mirror set, you are ready to complete Pulling the olm-utils-v3 image from the private container registry.