Enable Public Registry on OKD4x
Jump to navigation
Jump to search
By default registry is not open to public networks and only available for cluster members.
But you can open that by creating a public route, just tell the operator what to do.
1 BACKUP
oc project openshift-image-registry oc get configs.imageregistry.operator.openshift.io/cluster -o yaml > $HOME/backup_openshift-image-registry_configs.imageregistry.operator.openshift.io_cluster.yml
2 CONFIGURE OPERATOR
oc project openshift-image-registry oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
3 DOCKER LOGIN
3.1 Configure Insecure Registry if needed
PUB_REG=$(oc get route default-route -n openshift-image-registry --template='Template:.spec.host')
oc login -u some-admin podman login -u $(oc whoami) -p $(oc whoami -t) --tls-verify=false $PUB_REG docker login -u $(oc whoami) -p $(oc whoami -t) $PUB_REG