Failed to pull image kodekloud/examplevotingapp_worker:v1

Failed to pull image “kodekloud/examplevotingapp_worker:v1”: rpc error: code = Unknown desc = context deadline exceeded

Wondering if anyone has come across this error while trying to pull the image kodekloud/examplevotingapp_worker:v1 ? I was just playing with kubenetes services and have stumbled upon this error. Please find my screenshot below.

This is the yaml file that is causing issues for me.

I can confirm I am logged onto dockerhub with my credentials, screenshot below showing my dockerhub login. When I try to login to dockerhub I get messages like "
Authenticating with existing credentials…
Login Succeeded"

I am able to pull the docker image in question manually but it is failing when trying to deploy as a kubernetes deployment.

Any suggestions are welcome. Thank you

Hello @Vattikuti-ravi-shank,
Please follow these full steps to know what you have missed and try again :

Note: We will create deployments again so please before following the steps, Run kubectl delete deployment --all to delete old deployments and avoid any conflicts.

  1. Run git clone https://github.com/mmumshad/example-voting-app-kubernetes-v2.git

  2. Run cd example-voting-app-kubernetes-v2/

  3. Run vim postgres-deployment.yml and modify it’s content as below then save and exit.

Note: It’s a new update from Postgres.


apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: postgres-deployment
   labels:
     app: demo-voting-app
 spec:
   replicas: 1
   selector:
     matchLabels:
       name: postgres-pod
       app: demo-voting-app
   template:
     metadata:
       name: postgres-pod
       labels:
         name: postgres-pod
         app: demo-voting-app
     spec:
       containers:
       - name: postgres
         image: postgres:9.4
         env:
         - name: POSTGRES_USER
           value: postgres
         - name: POSTGRES_PASSWORD
           value: postgres
         - name: POSTGRES_HOST_AUTH_METHOD
           value: trust
         ports:
         - containerPort: 5432
  1. Run kubectl create -f . if you create deployments for the first time, if you created the same deployments before Run kubectl apply -f . .

  2. Run kubectl get service to get the exposed ports.

For example if the output of the command as above you can accces the voting app by hitting One_of_the_worker_nodes_IP:32733 on your browser and the same for the resulting app >> One_of_the_worker_nodes_IP:30013.

Check :

Note: The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.

Hope this helps!

Hello Ayman, thanks a lot for your help. Worker App is the app that I was having trouble with, having cloned the repository you pointed me and deleting all my existing deployments and services I had to start from the begining.

I see that the repository you pointed me to is using the image dockersamples/examplevotingapp_worker and the image I was having trouble with is the image kodekloud/examplevotingapp_worker:v1. I can confirm that the image dockersamples/examplevotingapp_worker is working as expected and I have managed to get the voting app working end to end.

Thank you
Ravi

Not sure, if this is still relevant.

But for someone who is still struggling with this error, the solution is the below command, you have to first download images on your minikube system and pull the image with docker pull then use it in the deployment manifest. Minikube isn’t able to understand the context for the image, hence throwing out the below error “Unknown desc = context deadline exceeded”

minikube ssh docker pull <dockerimageName>

3 Likes

Hello @Vattikuti-ravi-shank,
Happy learning!

^ solved the issue for me, thanks for sharing!

Unable to pull the worker-app image although I tried all the steps same as above.

Hello

same issue for me. The connection is reset after the command
minikube ssh docker pull dockersamples/examplevotingapp_worker

I have solved the issue. it was because the network configuration on my VM was wireless. With a wired connection, all is good.
Thanks for all.

Cool!
Happy learning!

kodekloud/examplevotingapp_worker is 1.7GB