Kubernetes deletes images even though there is enough space on disk
- [x] I have tried with the latest version of my channel (Stable or Edge)
- [x] I have uploaded Diagnostics
- Diagnostics ID: F4247974-830B-473B-8A69-7244D9ED6BC7/20200403093205
Expected behavior
Kubernetes should not initiate garbage collection of images if there is enough space on disk(less than 85%)
Actual behavior
Kubernetes is removing important images from my docker-desktop instance even though the disk is not so full. Here is a view of docker system -v command from yesterday
PS C:\WINDOWS\system32> docker system df -v
Images space usage:
REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
ubuntu-java rc3 6ea397989ce8 7 days ago 236.6MB 236.6MB 0B 0
ubuntu-java rc2 a9d07defea12 7 days ago 236.6MB 236.6MB 0B 0
ubuntu-java rc1 d2bea9c51242 7 days ago 236.6MB 236.6MB 0B 0
masked:5000/com/tt-wl R20.3.4 c2ff2f42df3d 9 days ago 5.204GB 5.12GB 83.9MB 0
masked:5000/com/tt-db R20.3.4 a64ce1394f30 9 days ago 15.08GB 10.81GB 4.27GB 0
ubuntu latest 4e5021d210f6 11 days ago 64.21MB 64.21MB 0B 0
plantuml/plantuml-server jetty f7e097353f81 13 days ago 403.1MB 0B 403.1MB 0
masked:5000/12c_tt latest f342501fe5c1 13 days ago 5.576GB 0B 5.576GB 0
12c_tt local 3f4c0587117f 3 weeks ago 5.146GB 0B 5.146GB 0
masked:5000/tt_db latest 18538ec8abb9 7 weeks ago 15.13GB 0B 15.13GB 0
masked:5000/oracle/serverjre latest ef9c1a0152ab 2 months ago 290.5MB 0B 290.5MB 0
alpine latest e7d92cdc71fe 2 months ago 5.591MB 0B 5.591MB 1
masked:5000/maven-alpine latest 01b36c67abc5 2 months ago 163.7MB 0B 163.7MB 1
k8s.gcr.io/kube-controller-manager v1.15.5 1399a72fa1a9 5 months ago 158.8MB 42.32MB 116.5MB 0
k8s.gcr.io/kube-proxy v1.15.5 cbd7f21fec99 5 months ago 82.41MB 42.32MB 40.09MB 0
k8s.gcr.io/kube-apiserver v1.15.5 e534b1952a0d 5 months ago 206.9MB 42.32MB 164.6MB 0
k8s.gcr.io/kube-scheduler v1.15.5 fab2dded59dd 5 months ago 81.11MB 42.32MB 38.79MB 0
masked:5000/com/tt-wl latest baf5c572ce55 9 months ago 5.12GB 5.12GB 0B 0
masked:5000/com/tt-db latest a96006f12f55 9 months ago 10.81GB 10.81GB 0B 0
docker/kube-compose-controller v0.4.23 a8c3d87a58e7 10 months ago 35.27MB 6.084MB 29.19MB 0
docker/kube-compose-api-server v0.4.23 f3591b2cb223 10 months ago 49.94MB 6.084MB 43.86MB 0
masked:5000/sshd latest 737973cb292b 10 months ago 415.3MB 0B 415.3MB 1
k8s.gcr.io/coredns 1.3.1 eb516548c180 14 months ago 40.3MB 0B 40.3MB 0
k8s.gcr.io/etcd 3.3.10 2c4adeb21b4f 16 months ago 258.1MB 0B 258.1MB 0
k8s.gcr.io/pause-amd64 3.1 da86e6ba6ca1 2 years ago 742.5kB 0B 742.5kB 0
Containers space usage:
CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES
481584cb01d0 sshd:latest "/bin/bash -c '/etc/…" 0 715kB 8 days ago Exited (137) 8 days ago deploy_20.1
547a8cd6101b masked:5000/maven-alpine:latest "mvn --settings=/usr…" 0 0B 8 days ago Exited (0) 8 days ago citrus_20.1
0b87b62d3741 alpine "ls data" 0 0B 5 weeks ago Exited (0) 5 weeks ago ct-alpine
Local Volumes space usage:
VOLUME NAME LINKS SIZE
Build cache usage: 0B
CACHE ID CACHE TYPE SIZE CREATED LAST USED USAGE SHARED
PS C:\WINDOWS\system32>
and here is a view from today where you can see a lot of images are gone after enabling the kubernetes
PS C:\Users\pvip> docker system df -v Images space usage:
REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
asdfdsfdsf.ab.cde.ef.ghi:5000/valerie_weblogic latest 34a8bb92cfa6 3 weeks ago 1.994GB 0B 1.994GB 0
asdfdsfdsf.ab.cde.ef.ghi:5000/valerie_database latest 3505c226c846 3 weeks ago 1.58GB 0B 1.58GB 1
docker/desktop-storage-provisioner v1.0 605a0f683b7b 4 weeks ago 33.09MB 0B 33.09MB 1
alpine latest e7d92cdc71fe 2 months ago 5.591MB 0B 5.591MB 1
asdfdsfdsf.ab.cde.ef.ghi:5000/maven-alpine latest 01b36c67abc5 2 months ago 163.7MB 0B 163.7MB 2
k8s.gcr.io/kube-controller-manager v1.15.5 1399a72fa1a9 5 months ago 158.8MB 42.32MB 116.5MB 2
k8s.gcr.io/kube-apiserver v1.15.5 e534b1952a0d 5 months ago 206.9MB 42.32MB 164.6MB 1
k8s.gcr.io/kube-proxy v1.15.5 cbd7f21fec99 5 months ago 82.41MB 42.32MB 40.09MB 1
k8s.gcr.io/kube-scheduler v1.15.5 fab2dded59dd 5 months ago 81.11MB 42.32MB 38.79MB 1
docker/kube-compose-controller v0.4.23 a8c3d87a58e7 10 months ago 35.27MB 6.084MB 29.19MB 1
docker/kube-compose-api-server v0.4.23 f3591b2cb223 10 months ago 49.94MB 6.084MB 43.86MB 1
sshd latest 737973cb292b 10 months ago 415.3MB 0B 415.3MB 1
k8s.gcr.io/coredns 1.3.1 eb516548c180 14 months ago 40.3MB 0B 40.3MB 2
k8s.gcr.io/etcd 3.3.10 2c4adeb21b4f 16 months ago 258.1MB 0B 258.1MB 1
k8s.gcr.io/pause-amd64 3.1 da86e6ba6ca1 2 years ago 742.5kB 0B 742.5kB 12
Containers space usage:
CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES
74492ff6abd9 1399a72fa1a9 "kube-controller-man…" 0 0B 36 hours ago Up 11 hours k8s_kube-controller-manager_kube-controller-manager-docker-desktop_kube-system_b2850863d2a1ddaac8ed962e6881584c_3
4d9d2bbebebd 1399a72fa1a9 "kube-controller-man…" 0 0B 36 hours ago Exited (255) 11 hours ago k8s_kube-controller-manager_kube-controller-manager-docker-desktop_kube-system_b2850863d2a1ddaac8ed962e6881584c_2
65ad6a8bf6f7 01b36c67abc5 "tail -f /dev/null" 3 0B 40 hours ago Up 15 hours k8s_citrus_citrus_default_18c66c49-60c8-49ed-a592-b422ca6b0114_0
17bf20dc8ba2 k8s.gcr.io/pause:3.1 "/pause" 0 0B 40 hours ago Up 15 hours k8s_POD_citrus_default_18c66c49-60c8-49ed-a592-b422ca6b0114_0
a5f9f829d93d asdfdsfdsf.ab.cde.ef.ghi:5000/valerie_database "/bin/sh -c $ORACLE_…" 0 1.39GB 40 hours ago Up 15 hours k8s_valerie-db_valdb20_default_6aebb978-a366-4039-8668-8b06f7df8a27_0
1c5341381e3b k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 15 hours k8s_POD_valdb20_default_6aebb978-a366-4039-8668-8b06f7df8a27_0
bc5c91bf79fd docker/desktop-storage-provisioner "/storage-provisione…" 0 0B 41 hours ago Up 16 hours k8s_storage-provisioner_storage-provisioner_kube-system_fe70cf20-9da0-4939-8c0c-40ab06f60d39_0
d292d79eeb31 k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_storage-provisioner_kube-system_fe70cf20-9da0-4939-8c0c-40ab06f60d39_0
a35fdaadb5e2 a8c3d87a58e7 "/compose-controller…" 0 857B 41 hours ago Up 16 hours k8s_compose_compose-7b7c5cbbcc-6hxll_docker_4c78a5a6-7dc4-4763-8242-280679d42ef0_0
3f0f0dafa9be eb516548c180 "/coredns -conf /etc…" 0 0B 41 hours ago Up 16 hours k8s_coredns_coredns-5c98db65d4-m4vmd_kube-system_6b3977f6-ca99-4260-8822-e12d1caf489a_0
fd11d1c38f89 eb516548c180 "/coredns -conf /etc…" 0 0B 41 hours ago Up 16 hours k8s_coredns_coredns-5c98db65d4-6n47n_kube-system_adbf47ae-dd61-423b-a01c-cd79d9c7428e_0
fd9c73ecc78a f3591b2cb223 "/api-server --kubec…" 0 5.16kB 41 hours ago Up 16 hours k8s_compose_compose-api-dbbf7c5db-9gnwm_docker_9e77c557-53e0-46c7-8b6b-f15b17db1e71_0
d39fecbbfa42 k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_compose-api-dbbf7c5db-9gnwm_docker_9e77c557-53e0-46c7-8b6b-f15b17db1e71_0
024a109bf75f k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_coredns-5c98db65d4-m4vmd_kube-system_6b3977f6-ca99-4260-8822-e12d1caf489a_0
47b789083fe0 k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_compose-7b7c5cbbcc-6hxll_docker_4c78a5a6-7dc4-4763-8242-280679d42ef0_0
1a499f552e0b k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_coredns-5c98db65d4-6n47n_kube-system_adbf47ae-dd61-423b-a01c-cd79d9c7428e_0
362273b053e0 cbd7f21fec99 "/usr/local/bin/kube…" 0 0B 41 hours ago Up 16 hours k8s_kube-proxy_kube-proxy-h9rx7_kube-system_92b6e2e7-e200-4277-9c76-2604c2514157_0
b5483fdb999d k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_kube-proxy-h9rx7_kube-system_92b6e2e7-e200-4277-9c76-2604c2514157_0
c791b89e57ca fab2dded59dd "kube-scheduler --bi…" 0 0B 41 hours ago Up 16 hours k8s_kube-scheduler_kube-scheduler-docker-desktop_kube-system_131c3f63daec7c0750818f64a2f75d20_0
0eee6648f4fb e534b1952a0d "kube-apiserver --ad…" 0 0B 41 hours ago Up 16 hours k8s_kube-apiserver_kube-apiserver-docker-desktop_kube-system_556b996466155d7ad37d896897208f67_0
5fa453ea57a2 k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_kube-scheduler-docker-desktop_kube-system_131c3f63daec7c0750818f64a2f75d20_0
c950ea8fa612 k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_kube-controller-manager-docker-desktop_kube-system_b2850863d2a1ddaac8ed962e6881584c_0
0feb76c7638f 2c4adeb21b4f "etcd --advertise-cl…" 0 0B 41 hours ago Up 16 hours k8s_etcd_etcd-docker-desktop_kube-system_f132e1c85abd4953a304d1c65d9d74f9_0
e3efed93a74e k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_kube-apiserver-docker-desktop_kube-system_556b996466155d7ad37d896897208f67_0
df016c3b4b1d k8s.gcr.io/pause:3.1 "/pause" 0 0B 41 hours ago Up 16 hours k8s_POD_etcd-docker-desktop_kube-system_f132e1c85abd4953a304d1c65d9d74f9_0
481584cb01d0 sshd:latest "/bin/bash -c '/etc/…" 0 715kB 10 days ago Exited (137) 9 days ago deploy_20.1
547a8cd6101b asdfdsfdsf.ab.cde.ef.ghi:5000/maven-alpine:latest "mvn --settings=/usr…" 0 0B 10 days ago Exited (0) 9 days ago citrus_20.1
0b87b62d3741 alpine "ls data" 0 0B 5 weeks ago Exited (0) 5 weeks ago ct-alpine
Local Volumes space usage:
VOLUME NAME LINKS SIZE
6e718f94178a023481f6375243d5f550913e50f84bc573d7031138e005057f17 1 0B
fa29a2542853ff66db24d79e6cd83856895adab549e756af4d8a21a39c5fadf9 1 0B
5f00514151e50afd656f8760370c0c87c5b7b604f939150f2965cf128adb96ec 1 0B
Build cache usage: 0B
CACHE ID CACHE TYPE SIZE CREATED LAST USED USAGE SHARED
PS C:\Users\pvip>
Information
- Windows Version: 1909 OS build - 18363.720
- Docker Desktop Version: 2.2.0.4 (stable)
- Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No
Steps to reproduce the behavior
- Disable kubernetes on the settings UI
- try building several images of significant size and let the disk usage grow above 85% - watch the disk usage reported by the UI and see that it is at (say) 90%.
- Then remove the images and ensure that docker system df -v reports low usage
- Enable Kubernetes on the settings UI
- Apply a new k8s yaml configuration to spin up a pod with service
After some minutes/hours, you can see that k8s ate up a lot of images like you can see in my above case - all that ubuntu-java images are gone when I tried to apply the valerie_weblogic and database images via k8s
I dont know if this is related to issue #6195 But there, I got the advice to open a new issue and hence this one.
Are you sure it's Kubernetes doing it? If it is, it's not under our control. We just bundle Kubernetes from the upstream project, so you'd be better to file a bug against Kubernetes.
I cant think of anybody else doing it because it happens only when i enable kubernetes from the docker settings UI. For the last one week I left the kubernetes option unchecked and everything was fine. Yesterday, I enabled it and boom, within minutes a lot of images are removed. The fact is even images that I have pulled personally which has nothing to do with kubernetes are removed. Cant you see something from the diagnostics that I attached with this ticket?
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked