Docker Image and it's Kubernetes Pod differ
Set imagePullPolicy
to Always
.
Sample:
apiVersion: v1kind: Podmetadata: name: demospec: containers: - name: image-name image: my-image:0.0.1 imagePullPolicy: Always # <<--here
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, set it toAlways
.
Use imagePullPolicy: Always
in your deployment
This option comes in handy if you deploy your application too often (Typical use case is CI/CD).
and one more thing if you want your image should be build fresh without any cache from local use --no-cache
command in docker build command.
docker build -t myimage/imagename . --no-cache