CA APM 10.7 Openshift agent image pull in local Docker repository shows "Failed to pull image"

Document ID : KB000109857
Last Modified Date : 07/08/2018
Show Technical Document Details
Issue:
VM running RHEL 7.2 with Docker installed. OpenShift v3.10 also installed. 
At the end of the CA APM 10.7 OpenShift Agent installation steps encountered a problem when creating the agent using the command:
oc create -f caagent-openshiftmonitor.yml
https://docops.ca.com/ca-apm/10-7/en/implementing-agents/infrastructure-agent/openshift-monitoring/install-and-configure-openshift-monitoring

The agent creation/deployment is failing due to private docker registry access problems i.e. the 2 caagent pods show ErrImagePull/"Failed to pull image" errors. Docker registry has been added to the insecure-registries on the docker daemon to fix a previous https problem but still seeing an “unauthorized: authentication required” error. 

# oc get pods 
NAME READY STATUS RESTARTS AGE 
caagent-deployment-65b568b489-fqss9 0/1 ErrImagePull 0 56m 
caagent-lsc25 0/1 ErrImagePull 0 56m 


# oc get events --sort-by='.lastTimestamp'|more 
… 
2m 2m 2 caagent-lsc25.153e614e8f6bbfe5 
Pod spec.containers{podmonitor} Warning Failed kubelet, localhost Failed to pull image "172.30.1.1:5000/caapm/apm-openshiftmonitor:latest": rpc error: code = Unknown desc = Get http://172.30.1.1:5000/v2/caapm/apm-openshiftmonitor/manifests/latest: unauthorized: authentication required 
2m 2m 2 caagent-deployment-65b568b489-fqss9.153e614e9 07861ec Pod spec.containers{osemetainfo} Warning Failed kubelet, localhost Failed to pull image "172.30.1.1:5000/caapm/apm-openshiftmonitor:latest": rpc error: code = Unknown desc = Get http://172.30.1.1:5000/v2/caapm/apm-openshiftmonitor/manifests/latest: unauthorized: authentication required
Cause:
Appears to be docker permissions related and nothing directly related to the agent image.
Resolution:
Workaround:
1. Deinstall agent using command:
oc delete -f caagent-openshiftmonitor.yml

2. Recreated agent using modified caagent-openshiftmonitor.yml file to get the image direct from the docker hub instead of local docker registry i.e. change the 2 image lines:
FROM: image: 172.30.1.1:5000/caapm/apm-openshiftmonitor:latest
TO: image: caapm/openshiftmonitor:latest