Moving images for cpd-cli plug-ins to a private container
registry
Several of the cpd-cli plug-ins use images. If your cluster
pulls images from a private container registry or if your cluster is in a restricted network, you
can push the images to the private container registry so that users can run the cpd-cli commands against the cluster.
- Who needs to complete this task?
- A user who has permissions to push images to the private container registry must complete this task.
- When do you need to complete this task?
- Complete this task if your cluster is in a restricted network or if your security policies
require all images to be pulled from a private container registry.
You can skip this task if your workstations can connect to the public internet and to the cluster at the same time.
Which cpd-cli plug-ins require images?
cpd-cli plug-in:| Plug-in | Purpose | Required images |
|---|---|---|
config |
Use this plug-in to create a local user configuration and profile to enable you to run
cpd-cli commands against an instance of IBM® Software Hub. |
This plug-in doesn't require any images. |
cpdbr |
Use this plug-in to back up and restore IBM Software Hub volumes. |
This plug-in requires the following images:
|
cpdbr-oadp |
Use this plug-in to back up and restore IBM Software Hub deployments, including volumes. |
This plug-in uses several images. The images that you need depend on the following factors:
|
cpdctl |
Use this plug-in to automate activities performed on different types of workspace and assets across multiple IBM Software Hub clusters. |
This plug-in doesn't require any images. |
cpdtool |
Use this plug-in to export and import data, including metadata. |
This plug-in requires the following images:
|
health |
Query the health of your Red Hat OpenShift cluster and IBM Software Hub. |
This plug-in requires the following images:
|
manage |
Use this plug-in to install and upgrade IBM Software Hub |
This plug-in requires the following images:
|
platform-diag |
Use this plug-in to gather diagnostic information about a IBM Software Hub deployment. |
This plug-in doesn't require any images. |
platform-mgmt |
Use this plug-in to manage service instances and users associated with a IBM Software Hub deployment. |
This plug-in doesn't require any images. |
Before you begin
Complete the following tasks before you move the images to the private container registry:
Mirroring the ose-cli and ubi-minimal images to the private container registry
cpd-cli
oadp commands, you must mirror the following images to your private
container registry:ose-cliubi-minimal
The steps that you must complete depend on whether the workstation can connect to both the internet and the private container registry at the same time:
The workstation can connect to the internet and to the private container registry
- Ensure that Docker or Podman is running on the workstation.
- Log in to the private container registry:
- Podman
-
podman login ${PRIVATE_REGISTRY_LOCATION} \ -u ${PRIVATE_REGISTRY_PUSH_USER} \ -p ${PRIVATE_REGISTRY_PUSH_PASSWORD} - Docker
-
docker login ${PRIVATE_REGISTRY_LOCATION} \ -u ${PRIVATE_REGISTRY_PUSH_USER} \ -p ${PRIVATE_REGISTRY_PUSH_PASSWORD}
- Log in to the Red
Hat
entitled registry.
- Set the
REDHAT_USERenvironment variable to the username of a user who can pull images fromregistry.redhat.io:export REDHAT_USER=<enter-your-username> - Set the
REDHAT_PASSWORDenvironment variable to the password for the specified user:export REDHAT_PASSWORD=<enter-your-password> - Log in to
registry.redhat.io:- Podman
-
podman login registry.redhat.io \ -u ${REDHAT_USER} \ -p ${REDHAT_PASSWORD} - Docker
-
docker login registry.redhat.io \ -u ${REDHAT_USER} \ -p ${REDHAT_PASSWORD}
- Set the
- Run the following commands to mirror the images the private container registry.
ose-cli-
The same image is used for all cluster hardware architectures.
oc image mirror registry.redhat.io/openshift4/ose-cli:latest ${PRIVATE_REGISTRY_LOCATION}/openshift4/ose-cli:latest --insecure ubi-minimal-
The same image is used for all cluster hardware architectures.
oc image mirror registry.redhat.io/ubi9/ubi-minimal:latest ${PRIVATE_REGISTRY_LOCATION}/ubi9/ubi-minimal:latest --insecure
The workstation cannot connect to the private container registry at the same time
- From a workstation that can connect to the internet:
- Ensure that Docker or Podman is running on the workstation.
- Ensure that the
olm-utils-v3image is available on the client workstation:cpd-cli manage restart-container - Log in to the Red
Hat
entitled registry.
- Set the
REDHAT_USERenvironment variable to the username of a user who can pull images fromregistry.redhat.io:export REDHAT_USER=<enter-your-username> - Set the
REDHAT_PASSWORDenvironment variable to the password for the specified user:export REDHAT_PASSWORD=<enter-your-password> - Log in to
registry.redhat.io:- Podman
-
podman login registry.redhat.io \ -u ${REDHAT_USER} \ -p ${REDHAT_PASSWORD} - Docker
-
docker login registry.redhat.io \ -u ${REDHAT_USER} \ -p ${REDHAT_PASSWORD}
- Set the
- Run the following commands to save the images to the client workstation:
ose-cli-
The same image is used for all cluster hardware architectures.
cpd-cli manage save-image \ --from=registry.redhat.io/openshift4/ose-cli:latest ubi-minimal-
The same image is used for all cluster hardware architectures.
cpd-cli manage save-image \ --from=registry.redhat.io/ubi9/ubi-minimal:latest
- Transfer the compressed files to a client workstation that can connect to the cluster.
Ensure that you place the TAR files in the
work/offlinedirectory.ose-cliregistry.redhat.io_openshift4_ose-cli_latest.tar.gzubi-minimalubi8_registry.redhat.io_ubi8_ubi-minimal_latest.tar.gz
- From the workstation that can connect to the cluster:
- Ensure that Docker or Podman is running on the workstation.
- Log in to the private container registry.
The following command assumes that you are using private container registry that is secured with credentials:
cpd-cli manage login-private-registry \ ${PRIVATE_REGISTRY_LOCATION} \ ${PRIVATE_REGISTRY_PUSH_USER} \ ${PRIVATE_REGISTRY_PUSH_PASSWORD}If your private registry is not secured, omit the username and password.
- Run the following commands to copy the images to the private container registry:
ose-cli-
cpd-cli manage copy-image \ --from=registry.redhat.io/openshift4/ose-cli:latest \ --to=${PRIVATE_REGISTRY_LOCATION}/openshift4/ose-cli:latest ubi-minimal-
cpd-cli manage copy-image \ --from=registry.redhat.io/ubi9/ubi-minimal:latest \ --to=${PRIVATE_REGISTRY_LOCATION}/ubi9/ubi-minimal:latest
Mirroring the cpd-cli
health image to the private container registry
The images for the cpd-cli
health commands are automatically mirrored to your private container
registry when you mirror the IBM Software Hub
(cpd_platform) images.
If you want to run these commands before you mirror the IBM Software Hub images, you can manually move the required images to your private container registry.
| Command | Required image |
|---|---|
storage-performance |
k8s-storage-perf |
storage-validation |
k8s-storage-test |
network-performance |
ibm-network-performance |
The steps that you must complete depend on whether the workstation can connect to both the internet and the private container registry at the same time:
The workstation can connect to the internet and to the private container registry
Ensure that you source the environment variables before you run the commands in this task.
- Ensure that Docker or Podman is running on the workstation.
- Log in to the private container
registry:
cpd-cli manage login-private-registry \ ${PRIVATE_REGISTRY_LOCATION} \ ${PRIVATE_REGISTRY_PUSH_USER} \ ${PRIVATE_REGISTRY_PUSH_PASSWORD} - Run the following command to mirror the relevant image the private container registry.
k8s-storage-perf-
cpd-cli manage copy-image \ --from=icr.io/cpopen/cpd/k8s-storage-perf:${VERSION}.${IMAGE_ARCH} \ --to=${PRIVATE_REGISTRY_LOCATION}/cpopen/cpd/k8s-storage-perf:${VERSION}.${IMAGE_ARCH} k8s-storage-test-
cpd-cli manage copy-image \ --from=icr.io/cpopen/cpd/k8s-storage-test:${VERSION}.${IMAGE_ARCH} \ --to=${PRIVATE_REGISTRY_LOCATION}/cpopen/cpd/k8s-storage-test:${VERSION}.${IMAGE_ARCH} ibm-network-performance-
cpd-cli manage copy-image \ --from=icr.io/cpopen/cpd/ibm-network-performance:${VERSION}.${IMAGE_ARCH} \ --to=${PRIVATE_REGISTRY_LOCATION}/cpopen/cpd/ibm-network-performance:${VERSION}.${IMAGE_ARCH}
The workstation cannot connect to the private container registry at the same time
- From a workstation that can connect to the internet:
- Ensure that Docker or Podman is running on the workstation.
- Ensure that the
olm-utils-v3image is available on the client workstation:cpd-cli manage restart-container - Run the following command to save the relevant image to the client workstation:
k8s-storage-perf-
cpd-cli manage save-image \ --from=icr.io/cpopen/cpd/k8s-storage-perf:${VERSION}.${IMAGE_ARCH} k8s-storage-test-
cpd-cli manage save-image \ --from=icr.io/cpopen/cpd/k8s-storage-test:${VERSION}.${IMAGE_ARCH} ibm-network-performance-
cpd-cli manage save-image \ --from=icr.io/cpopen/cpd/ibm-network-performance:${VERSION}.${IMAGE_ARCH}
- Transfer the compressed file to a client workstation that can connect to the cluster.Ensure that you place the TAR file in the
work/offlinedirectory. TheTARfiles have the following format:k8s-storage-perficr.io_cpopen_cpd_k8s-storage-perf_${VERSION}.${IMAGE_ARCH}.tar.gzk8s-storage-testicr.io_cpopen_cpd_k8s-storage-test_${VERSION}.${IMAGE_ARCH}.tar.gzibm-network-performancecpopen_cpd_ibm-network-performance_${VERSION}.${IMAGE_ARCH}.tar.gz
- From the workstation that can connect to the cluster:
- Ensure that Docker or Podman is running on the workstation.
- Log in to the private container registry.
The following command assumes that you are using private container registry that is secured with credentials:
cpd-cli manage login-private-registry ${PRIVATE_REGISTRY_LOCATION} \ ${PRIVATE_REGISTRY_PUSH_USER} \ ${PRIVATE_REGISTRY_PUSH_PASSWORD}If your private registry is not secured, omit the username and password.
- Run the following command to copy the relevant image to the private container registry:
k8s-storage-perf-
cpd-cli manage copy-image \ --from=icr.io/cpopen/cpd/k8s-storage-perf:${VERSION}.${IMAGE_ARCH} \ --to=${PRIVATE_REGISTRY_LOCATION}/cpopen/cpd/k8s-storage-perf:${VERSION}.${IMAGE_ARCH} k8s-storage-test-
cpd-cli manage copy-image \ --from=icr.io/cpopen/cpd/k8s-storage-test:${VERSION}.${IMAGE_ARCH} \ --to=${PRIVATE_REGISTRY_LOCATION}/cpopen/cpd/k8s-storage-test:${VERSION}.${IMAGE_ARCH} ibm-network-performance-
cpd-cli manage copy-image \ --from=icr.io/cpopen/cpd/ibm-network-performance:${VERSION}.${IMAGE_ARCH} \ --to=${PRIVATE_REGISTRY_LOCATION}/cpopen/cpd/ibm-network-performance:${VERSION}.${IMAGE_ARCH}
What to do next
After the images are mirrored or pushed to the private container registry, users must ensure that
the cpd-cli plug-ins use the images from the private container
registry.
| Plug-in | How to use the images in the private container registry |
|---|---|
config |
Not applicable. This plug-in doesn't require any images. |
cpdbr |
Specify the --image-prefix=${PRIVATE_REGISTRY_LOCATION} option when you run the cpd-cli
backup-restore
init command. |
cpdbr-oadp |
Specify the --image-prefix=${PRIVATE_REGISTRY_LOCATION} option when you run some cpd-cli
oadp commands. |
cpdctl |
Not applicable. This plug-in doesn't require any images. |
cpdtool |
Specify the --image-prefix=${PRIVATE_REGISTRY_LOCATION} option when you run the cpd-cli
export-import
init command. |
health |
The next steps depend on the commands that you want to run:
|
manage |
|
platform-diag |
Not applicable. This plug-in doesn't require any images. |
platform-mgmt |
Not applicable. This plug-in doesn't require any images. |