Steps to Get Image Pull Secret for IBM Container Registry
Log in to IBM Cloud CLI: If you haven't already, install the IBM Cloud CLI and log in to your IBM Cloud account:
Install the Container Registry Plugin: If you don’t have the Container Registry plugin installed, install it:
Log in to IBM Container Registry: After installing the plugin, log in to the IBM Cloud Container Registry:
Generate API Key (Optional, but preferred for automation): Create an API key to securely authenticate with the IBM Container Registry. You can use it later to create the image pull secret in OpenShift:
Create an Image Pull Secret in OpenShift: Now, create the secret that allows OpenShift to pull images from the IBM Container Registry. You can use your IBM Cloud account credentials or an API key for authentication.
For API Key authentication:
Replace:
icr.io
with the appropriate IBM Container Registry region endpoint (us.icr.io
,eu.icr.io
,jp.icr.io
, etc.).<your-email>
with your email address.
For IBM Cloud Username/Password authentication:
Link the Image Pull Secret to a Service Account: To use this secret, associate it with the default service account in your project:
Ensure the secret is linked to the default service account:
Deploy the Container: Once the image pull secret is in place, you can deploy the container in OpenShift by creating a deployment configuration or pod that uses the image from IBM Container Registry:
After this, OpenShift will pull the image from IBM Cloud Container Registry using the credentials stored in the secret.
Region Endpoints for IBM Container Registry
Choose the correct container registry endpoint based on your region:
us.icr.io
- US Southeu.icr.io
- Frankfurtjp.icr.io
- Tokyo
Make sure to replace the region in the docker-server
and image URL accordingly.