MiyRon
MiyRon

Reputation: 436

minikube does not download a public docker image

Good day!

I am facing a strange problem. I have a standard deployment that uses a public image. But when I create it, I get the error ImagePullBackOff

$ kubectl get pods

result

api-gateway-deployment-74968fbf5c-cvqwj   0/1     ImagePullBackOff   0          6h23m
api-gateway-gateway-deployment-74968fbf5c-hpdxb   0/1     ImagePullBackOff   0          6h23m
api-gateway-gateway-deployment-74968fbf5c-rctv6   0/1     ImagePullBackOff   0          6h23m

my deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-gateway-deployment
  labels:
    app: api-gateway-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: api-gateway-deployment
  template:
    metadata:
      labels:
        app: api-gateway-deployment
    spec:
      containers:
      - name: api-gateway-node
        image: creatorsprodhouse/api-gateway:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80

I am using the docker driver, is there anything I can do wrong?

minikube start --driver=docker

Upvotes: 2

Views: 763

Answers (1)

Ali
Ali

Reputation: 1495

I think your internet connection is slow. The timeout to pull an image is 120 seconds, so kubectl could not pull the image in under 120 seconds.

First, pull the image via Docker

docker image pull creatorsprodhouse/api-gateway:latest

Then load the downloaded image to minikube

minikube image load creatorsprodhouse/api-gateway:latest

And then everything will work because now kubectl will use the image that is stored locally.

Upvotes: 4

Related Questions