--image-pull-policy not working in kubernetes

+1 vote

I have pushed a custom image on dockerhub lets say for this example the image is test:latest. My kubernetes deployment is using this image and I was expecting a new deployment of the pods when I push the new version of the image.

I've created my deployment like this:

kubectl run sample-app --image=`test:latest` --namespace=sample-app --image-pull-policy Always

But this is not happening. What am I doing wrong here?

Dec 6, 2018 in Kubernetes by shubham
• 7,340 points
4,974 views

1 answer to this question.

+1 vote
Kubernetes does not automatically update the pods with the new image when a new version of it is pushed onto dockerhub. The image pull poliyc just tells kubernetes how to acquire the image required for container to run. This means whenever a pod is being created the latest or new version of image will be pulled from dockerhub. If you want to see this update whenever you update the image, just delete the pods associated with the deployment(not the deployment itself).

One other thing you can do is tag the images with version and whenever a new version is uploaded use rolling-update to update all the containers.
answered Dec 6, 2018 by DareDev
• 6,890 points

Related Questions In Kubernetes

0 votes
3 answers

Retry pull image in a kubernetes pod

If the Pod is part of a ...READ MORE

answered Aug 29, 2018 in Kubernetes by Hannah
• 18,570 points
6,232 views
0 votes
1 answer

Not able to pull image from gcr.io

There was a recent outage to gce ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,360 points
1,021 views
0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 52,360 points
814 views
+1 vote
1 answer
+2 votes
1 answer
0 votes
1 answer

External IP not working with Minikube Kubernetes

You can use an ingress controller on ...READ MORE

answered Jan 24, 2019 in Kubernetes by DareDev
• 6,890 points
2,333 views
0 votes
3 answers

Using multiple commands in a kubernetes yaml file

Try something like this: containers: - name: ...READ MORE

answered Apr 23, 2019 in Kubernetes by lyza
48,936 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP