--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
• 6,560 points
423 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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,670 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
• 14,080 points
635 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
• 36,220 points
74 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
• 36,220 points
32 views
0 votes
2 answers

DNS does not resolve with NGINX in Kubernetes

adding to @kalgi's answer Using just the hostname ...READ MORE

answered Aug 30, 2018 in Kubernetes by Nilesh
• 6,900 points
286 views
0 votes
1 answer
0 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 in Kubernetes by DareDev
• 6,670 points
187 views
0 votes
3 answers

Using multiple commands in a kubernetes yaml file

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

answered Apr 23 in Kubernetes by lyza
2,771 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.