This describes the steps on how to push an image to your local OpenShift cluster; specifically the internal registry; and then deploy that.
- You are logged into the cluster
- You have the image to push to the cluster on your local computer
docker pull quay.io/jkeam/hello-python
- Make Internal Registry Public
oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
- Give Yourself Access - Assuming you are logged in as
opentlc-mgr
oc policy add-role-to-user registry-viewer opentlc-mgr
oc policy add-role-to-user registry-editor opentlc-mgr
- Create project/namespace
oc new-project jon
- Login
HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
# podman login -u kubeadmin -p $(oc whoami -t) --tls-verify=false $HOST
docker login -u kubeadmin -p $(oc whoami -t) $HOST
- Tag Image, notice
jon
is the project andhello-python
is the image name
docker tag quay.io/jkeam/hello-python $HOST/jon/hello-python
- Push Image
docker push $HOST/jon/hello-python
- Use the following in your
deployment.yaml
image: image-registry.openshift-image-registry.svc:5000/jon/hello-python