How does Docker image clean up works on kubernetes?

4/21/2019

I have k8s cluster with three workers and when I explicitly creates the pod, corresponding docker images get downloaded to worker. When I explicitly deletes the pods corresponding docker images are still present on worker nodes. Is this expected case?

-- rgaut
amazon-eks
docker
kubernetes

1 Answer

4/21/2019

Is this expected case?

Possibly, considering the Kubernetes Garbage collection policy for images:

Kubernetes manages lifecycle of all images through imageManager, with the cooperation of cadvisor.

The policy for garbage collecting images takes two factors into consideration: HighThresholdPercent and LowThresholdPercent.
Disk usage above the high threshold will trigger garbage collection.
The garbage collection will delete least recently used images until the low threshold has been met.

-- VonC
Source: StackOverflow