When I was trying to create a deployment in microk8s, I got some problem with docker images.
My yaml looks like this,as you can see,I use the IfNotPresent ImagePullPolicy to create my deployment:
I pull the image to my docker:
However, it seems k8s cannot find the images inside my computer:
Anyone can help me to solve the problem?
Posting @朱江源 solution as community wiki.
Use "docker tag k8s.gcr.io/heapster-grafana-amd64:v1.3.3 {your dockerhub account}/heapster-grafana-amd64:v1.3.3" to rename your image.
Then use "docker push {your dockerhub account}/heapster-grafana-amd64:v1.3.3" to push the image into you dockerhub. At the same time, you need to change the image location of your pod to "{your dockerhub account}/heapster-grafana-amd64:v1.3.3". In this way, you can use "docker create -f xxx,yaml" to create your pod.
Additionally there are container registry proxies for users from China:
global proxy in China format
dockerhub (docker.io) dockerhub.azk8s.cn dockerhub.azk8s.cn/<repo-name>/<image-name>:<version>
gcr.io gcr.azk8s.cn gcr.azk8s.cn/<repo-name>/<image-name>:<version>
quay.io quay.azk8s.cn quay.azk8s.cn/<repo-name>/<image-name>:<version>
mcr.microsoft.com mcr.azk8s.cn mcr.azk8s.cn/<repo-name>/<image-name>:<version>