Accessing the Internal Registry from ARO
This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.
Kevin Collins
06/28/2022
One of the advantages of using OpenShift is the internal registry that comes with OpenShfit to build, deploy and manage container images locally. By default, access to the registry is limited to the cluster ( by design ) but can be extended to usage outside of the cluster. This guide will go through the steps required to access the OpenShift Registry on an ARO cluster outside of the cluster.
Prerequisites
- an ARO Cluster
- oc cli
- podman or docker cli
Expose the Registry
Expose the registry service
oc patch config.imageregistry.operator.openshift.io/cluster --patch='{"spec":{"defaultRoute":true}}' --type=merge oc patch config.imageregistry.operator.openshift.io/cluster --patch='[{"op": "add", "path": "/spec/disableRedirect", "value": true}]' --type=json
Get the route host name
HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
Log into the image registry
podman login -u $(oc whoami) -p $(oc whoami -t) $HOST
Test it out
podman pull $HOST/openshift/cli
podman images
Expected output:
default-route-openshift-image-registry.apps.<domain>/openshift/cli latest aa85757767cb 3 weeks ago 615 MB