Updating docs around default ImagePullPolicy (#10284)

* Updating docs around default ImagePullPolicy

This is an attempt to clear up a bit of the wording around an image's tag and how that impacts the ImagePullPolicy.

The wording to me presently suggests *all* you need to do is use `:latest` as an image tag and that will change the `ImagePullPolicy` to latest.

This is not the case that I've observed.  As it stands now, `:latest` only affect the `ImagePullPolicy` if that attribute is not present on the pod's specification.

https://github.com/kubernetes/kubernetes/blob/7f23a743e8c23ac6489340bbb34fa6f1d392db9d/pkg/apis/core/v1/defaults.go#L78
https://github.com/kubernetes/kubernetes/blob/7f23a743e8c23ac6489340bbb34fa6f1d392db9d/pkg/kubelet/images/image_manager_test.go#L63

* Addressing feedback

- Thanks for the super valuable feedback @Bradamant3.  It reads a *lot* better now!
This commit is contained in:
Justin Nauman
2018-09-21 09:43:29 -05:00
committed by k8s-ci-robot
parent e743d4032f
commit d73e26c75b
2 changed files with 21 additions and 9 deletions
@@ -25,13 +25,11 @@ The default pull policy is `IfNotPresent` which causes the Kubelet to skip
pulling an image if it already exists. If you would like to always force a pull,
you can do one of the following:
- set the `imagePullPolicy` of the container to `Always`;
- use `:latest` as the tag for the image to use;
- set the `imagePullPolicy` of the container to `Always`.
- omit the `imagePullPolicy` and use `:latest` as the tag for the image to use.
- omit the `imagePullPolicy` and the tag for the image to use.
- enable the [AlwaysPullImages](/docs/reference/access-authn-authz/admission-controllers/#alwayspullimages) admission controller.
If you did not specify tag of your image, it will be assumed as `:latest`, with
pull image policy of `Always` correspondingly.
Note that you should avoid using `:latest` tag, see [Best Practices for Configuration](/docs/concepts/configuration/overview/#container-images) for more information.
## Using a Private Registry