How to remove image from kubernetes(GKE) - Container image "<name/name>:latest" already present on machine

9/12/2018

I have a failing public docker hub container and if I kubectl apply -f ... with the same version, :latest in this case, I am getting:

Container image "<name/name>:latest" already present on machine

I don't see the image anywhere, in this case I am running on Google Kubernetes Engine - and it is not in the google container registry.

The solution or workaround, is of course to fix the code error in the docker container, and add to the version number and push again - then it all works and get pulled.

But is there no way to clear the image in Kubernetes, something like in docker docker rmi <name/name>:latest?

-- Chris G.
kubernetes

1 Answer

9/12/2018

I think use latest tag - not the best. But if it is necessary, official workaround imagePullPolicy=Always.

Why this not best way? More info can find this.

-- Arslanbekov
Source: StackOverflow