<p>I have an image on docker hub that I using in a kubernetes deployment. I'm try to debug the application but whenever I make a change to the image, even with a change in the tag, when I deploy the app it still uses the old image? It does update occasionally but without any rhyme or reason. This is with the imagePullPolicy set to Always.</p>
<p>Here is the deployment file</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
        - name: frontend
          image: myid/myapp:0.2.5
          imagePullPolicy: Always
          resources:
            requests:
              memory: &quot;2Gi&quot;
              cpu: 1
              ephemeral-storage: &quot;2Gi&quot;
            limits:
              memory: &quot;2Gi&quot;
              cpu: 1
              ephemeral-storage: &quot;2Gi&quot;
          ports:
            - containerPort: 3838
              name: shiny-port
            - containerPort: 8080
              name: web-port
      imagePullSecrets:
        - name: myregistrykey
</code></pre>
<p>I deploy it using the command</p>
<p>kubectl create -f deployment.yaml</p>
<p>Thanks</p>

bbcho
<p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p>
<p>As mentioned in comments:</p>
<ul>
<li>you need to check which <code>tag</code> is used - he same or different than in the previous version of the image;</li>
<li>update your Deployment with actual image;</li>
<li>check, if your image available in Docker hub, otherwise you will get <code>ErrImagePull</code> status during pod checking.</li>
</ul>
<p>In case you just want to update an image, it is better to use <code>kubectl apply -f deployment.yaml</code> instead of <code>kubectl create -f deployment.yaml</code>.</p>
