Configuring the global image pull secret
Configure the global image pull secret so that you can pull image sources from the IBM
Entitled Registry.
Procedure
- Configure the pull secret to pull images from the IBM Entitled Registry, the global image
pull secret must contain your IBM entitlement API key.
export IBM_ENTITLEMENT_SERVER=cp.icr.io export IBM_ENTITLEMENT_USER=cp export IBM_ENTITLEMENT_KEY=xxxxx - Create an environment variable that points to a temporary directory on your workstation.
For example:
export WORK_ROOT=$HOME/temp/workNote: If the temporary directory you choose does not exist, you must create it before proceeding with the next step. - Perform the oc login command.
You can access your Red Hat® OpenShift® cluster by using
occommand directly from a Terminal in the client machineocwas installed to.To do so:
- Go to the Red Hat OpenShift web console.
- Click your login name and select the option: Copy login command.
- Click View token.
- Copy the entire command line under the Log in section with this token.
- Paste it in the Terminal of the client machine where
ocwas installed to and run the command. You should see a message saying that you can access a number of projects and a default project selected.
From now on, next time you runoccommands in this opened Terminal in the client machine, it will be running theoccommands in your OpenShift cluster. - Download the pull secret to the temporary directory:
oc get secret/pull-secret \ -n openshift-config \ --template='{{index .data ".dockerconfigjson" | base64decode}}' > ${WORK_ROOT}/global_pull_secret.cfg - Add the new pull secret to the local copy of the
global_pull_secret.cfg file:
oc registry login \ --registry="${IBM_ENTITLEMENT_SERVER}" \ --auth-basic="${IBM_ENTITLEMENT_USER}:${IBM_ENTITLEMENT_KEY}" \ --to=${WORK_ROOT}/global_pull_secret.cfg - Update the global pull secret on your cluster:
oc set data secret/pull-secret \ -n openshift-config \ --from-file=.dockerconfigjson=${WORK_ROOT}/global_pull_secret.cfg