Question: I'm deploying several services to my local cluster (`minikube`) using [DevSpace tool](https://devspace.sh/). 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 `minikube` 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.

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.

Can someone point where they are stored, how I can review and remove them? Thanks.

Answer: 
DevSpace maintainer here. What you need is 2 things:

1. Something that forces your pods to be recreated each time you run `devspace dev`. 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.
2. An `imagePullPolicy: Always` 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.

In combination, this could look like this within your `devspace.yaml` file (if you are using the component-chart deployment):

```
deployments:
- name: my-component
  helm:
    componentChart: true
    values:
      labels:
        timestamp: $!{DEVSPACE_TIMESTAMP}  # here is 1.
      containers:
      - image: "YOUR_IMAGE:latest"         # specify any tag here that you want
        imagePullPolicy: Always            # here is 2.

```

`$!{DEVSPACE_TIMESTAMP}` = `$!{}` forces to place the value of this var as a string (because k8s only allows string values for labels) and `DEVSPACE_TIMESTAMP` is the name of a predefined variable in DevSpace. More details here: <https://devspace.sh/cli/docs/configuration/variables/basics#predefined-variables>
You can try below commands

**Removing untagged images**:

```text
docker image rm $(docker images | grep "^<none>" | awk "{print $3}")

```

**Remove all stopped containers** :

```text
docker container rm $(docker ps -a -q)

```

(OR)

You need to stop and disable localkube service:

```text
systemctl disable localkube.service
systemctl stop localkube.service

```

After that you're able to stop and remove containers.

```text
docker system prune -a

```

which removes all the images