1

I have uploaded my image on ACR. When I try to deploy it using a deployment.yaml with kubectl commands, the kubectl get pods command shows ErrImageNeverPull in the pods.

Also, I am not using minikube. Is it necessary to use minikube for this? I am a beginner in azure/kubernetes.

I've also used imagePullPolicy: Never in the yaml file. It's not working even without this and shows ImagePullBackOff.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
Payal Jindal
  • 37
  • 1
  • 7
  • https://stackoverflow.com/questions/34848422/how-to-debug-imagepullbackoff – Sajeetharan Aug 01 '21 at 05:54
  • Can you edit the question to include a [mcve]? How are you building your image and pushing it to ACR? – David Maze Aug 01 '21 at 10:38
  • 1
    (`ErrImageNeverPull` means you've specified `imagePullPolicy: Never` but the image isn't already on the node. You can't use it in AKS, or really any environment other than a local-desktop installation.) – David Maze Aug 01 '21 at 10:39
  • 1
    @DavidMaze is right, probably it does not make a lot of sense to use `imagePullPolicy: Never` in an environment like AKS. You may want to read [this](https://kubernetes.io/docs/concepts/configuration/overview/#container-images). The way forward is likely to set the policy to `IfNotPresent` or `Always`. These pods ending up in `ImagePullBackOff` is another issue. I suggest running `kubectl describe pod` to troubleshoot these, and if needed, ask for help about _that_ issue. – Emile Pels Aug 01 '21 at 10:52
  • Thank you so much for replying. I got your point that I should not use `imagePullPolicy: Never` because it's for local installation. I'll try running without it and run `kubectl describe pod` for `ImagePullBackOff` issue. Will ask for help if I couldn't solve the issue. Thanks again. – Payal Jindal Aug 01 '21 at 13:58
  • @PayalJindal, any progress? – Mikołaj Głodziak Aug 02 '21 at 07:19
  • Yes, it worked fine. There was a problem with my docker installation. – Payal Jindal Aug 04 '21 at 09:20

1 Answers1

3

As Payal Jindal mentioned in the comment:

It worked fine. There was a problem with my docker installation.

Problem is now resolved. The way forward is to set the image pull policy to IfNotPresent or Always.

spec:
    containers:
        - imagePullPolicy: Always
Nav
  • 19,885
  • 27
  • 92
  • 135
Mikołaj Głodziak
  • 4,775
  • 7
  • 28