Is it not possible to have a docker-registry running in kubernetes and then port-forward to and then use this registry when deploying?
kubectl apply -f deploy-registry.yaml
and then
kubectl port-forward docker-registry-vx 5000:5000
The reason that you're having trouble is that the kubelet agent running on the node where the pod is scheduled is what pulls the container image, not your workstation, and port-forwarding the registry to your local workstation does not provide this access.
In previous Kubernetes versions, there was to be a registry cluster addon, but that has been taken out of the mainline tree (though some distributions like Microk8s and Minikube have their own), so you will need to use a bit of elbow grease to get this working. I would caution, though, that using a registry external to the cluster, such as Google Container Registry (GKE), or even just a private Docker Hub repository is, generally, a much better design pattern for production use as it avoids things like circular dependencies and also removes the operational effort of keeping the registry running and secured.
In general, the steps are:
image
field on the Pod/Deployment spec.A related question can be found here: Kubernetes: Pull images from internal registry with on-premise deployment and a reasonably comprehensive blog post can be found here: https://medium.com/@jmarhee/deploying-a-docker-registry-with-persistent-storage-and-local-only-access-on-your-kubernetes-1c6470d3611c