简体   繁体   中英

Getting an error when trying to find a local image with helm/docker

I have a local kube.netes cluster (minikube), that is trying to load images from my local Docker repo.

When I do a "docker images", I get:

cluster.local/container-images/app-shiny-app-validation-app-converter            1.6.9
cluster.local/container-images/app-shiny-app-validation                          1.6.9

Given I know the above images are there, I run some helm commands which uses these images, but I get the below error:

Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   BackOff    66s (x2 over 2m12s)  kubelet            Back-off pulling image "cluster.local/container-images/app-shiny-app-validation-app-converter:1.6.9"
  Warning  Failed     66s (x2 over 2m12s)  kubelet            Error: ImagePullBackOff
  Normal   Pulling    51s (x3 over 3m24s)  kubelet            Pulling image "cluster.local/container-images/app-shiny-app-validation-app-converter:1.6.9"
  Warning  Failed     11s (x3 over 2m13s)  kubelet            Failed to pull image "cluster.local/container-images/app-shiny-app-validation-app-converter:1.6.9": rpc error: code = Unknown desc = Error response from daemon: Get https://cluster.local/v2/: dial tcp: lookup cluster.local: Temporary failure in name resolution
  Warning  Failed     11s (x3 over 2m13s)  kubelet            Error: ErrImagePull

Anyone know how I can fix this? Seems the biggest problem is Get https://cluster.local/v2/: dial tcp: lookup cluster.local: Temporary failure in name resolution

  1. Add cluster.local to your /etc/hosts file in all your kube.netes nodes.
192.168.12.34 cluster.local
  1. Check whether you can login to registry using docker login cluster.local
  2. If your registry has self-signed certificates, copy cluster.local.crt key to all kube.netes worker nodes /etc/docker/certs.d/cluster.local/ca.crt

Since minikube is being used, you can refer to their documentation. It is recommended that if a imagePullPolicy is being used, it needs to be set to Never . If set to Always , it will try to reach out and pull from the.network.

From docs: https://minikube.sigs.k8s.io/docs/handbook/pushing/ "Tip 1: Remember to turn off the imagePullPolicy:Always (use imagePullPolicy:IfNotPresent or imagePullPolicy:Never) in your yaml file. Otherwise Kube.netes won't use your locally build image and it will pull from the.network."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM