<p>I'm deploying several services to my local cluster (<code>minikube</code>) using <a href="https://devspace.sh/" rel="nofollow noreferrer">DevSpace tool</a>. Once someone makes changes to one of the services and pushes the image to our private repo, I need these changes to be available on my local then. What I do now is I completely delete <code>minikube</code> cluster and start a new one. In this case all images with same tags are just updated with the latest version, not a cached one.</p>
<p>But I believe there is some more elegant way to overcome this. So, I need to cleanup/remove/delete outdated images from my local cluster somehow before re-deploying services there.</p>
<p>Can someone point where they are stored, how I can review and remove them? Thanks.</p>

vitali_li
<p>DevSpace maintainer here. What you need is 2 things:</p>
<ol>
<li>Something that forces your pods to be recreated each time you run <code>devspace dev</code>. So, if you are using a Deployment or StatefulSet, you can add something like a label, e.g. containing the DevSpace built-in timestamp variable as value to your pod template.</li>
<li>An <code>imagePullPolicy: Always</code> in your pod spec to ensure that Kubernetes always pulls the newest image for each newly created pod. Otherwise Kubernetes would use the already cached image.</li>
</ol>
<p>In combination, this could look like this within your <code>devspace.yaml</code> file (if you are using the component-chart deployment):</p>
<pre><code>deployments:
- name: my-component
  helm:
    componentChart: true
    values:
      labels:
        timestamp: $!{DEVSPACE_TIMESTAMP}  # here is 1.
      containers:
      - image: &quot;YOUR_IMAGE:latest&quot;         # specify any tag here that you want
        imagePullPolicy: Always            # here is 2.
</code></pre>
<p><code>$!{DEVSPACE_TIMESTAMP}</code> = <code>$!{}</code> forces to place the value of this var as a string (because k8s only allows string values for labels) and <code>DEVSPACE_TIMESTAMP</code> is the name of a predefined variable in DevSpace. More details here: <a href="https://devspace.sh/cli/docs/configuration/variables/basics#predefined-variables" rel="noreferrer">https://devspace.sh/cli/docs/configuration/variables/basics#predefined-variables</a></p>
