I am able to a launch an application with the Redis image from RedHat - registry.redhat.io/rhel8/redis-5
using the following steps.
apiVersion: v1
kind: Secret
metadata:
name: accoutNum-userName-pull-secret
data:
.dockerconfigjson: token-value....long........string
type: kubernetes.io/dockerconfigjson
Add secret and import image:
oc create -f secret.yaml
oc import-image rhel8/redis-5 --from=registry.redhat.io/rhel8/redis-5 --confirm
The image meta data is imported:
oc get is
NAME DOCKER REPO TAGS UPDATED
redis-5 172.30.1.1:5000/project/redis-5 latest About a minute ago
I am not clear how the import statement locates the secret to be used.
OpenShift lookup automatically the authentication from type of kubernetes.io/dockerconfigjson
in the same namespace(project) if the registry is required authentication when pulling/push images. So if you need to access multiple external registry, then just create matched secret with the credential per registry.
I hope it help you, thanks.