Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement minikube image ls #10933

Closed
afbjorklund opened this issue Mar 26, 2021 · 7 comments · Fixed by #11007
Closed

Implement minikube image ls #10933

afbjorklund opened this issue Mar 26, 2021 · 7 comments · Fixed by #11007
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@afbjorklund
Copy link
Collaborator

Another simple wrapper, this time for crictl images.

Could be useful when using load and rm, perhaps ?

@afbjorklund afbjorklund added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Mar 26, 2021
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 26, 2021

Sample output:

Containerd

IMAGE                                     TAG                  IMAGE ID            SIZE
docker.io/kindest/kindnetd                v20210220-5b7e6d01   2b60427ffa5fe       54.6MB
docker.io/kubernetesui/dashboard          v2.1.0               9a07b5b4bfac0       68MB
docker.io/kubernetesui/metrics-scraper    v1.0.4               86262685d9abb       16MB
docker.io/library/alpine                  latest               28f6e27057430       3.06MB
docker.io/library/busybox                 latest               a9d583973f65a       816kB
gcr.io/k8s-minikube/storage-provisioner   v4                   85069258b98ac       8.88MB
k8s.gcr.io/coredns                        1.7.0                bfe3a36ebd252       14MB
k8s.gcr.io/etcd                           3.4.13-0             0369cf4303ffd       86.7MB
k8s.gcr.io/kube-apiserver                 v1.20.2              a8c2fdb8bf76e       30.4MB
k8s.gcr.io/kube-controller-manager        v1.20.2              a27166429d98e       29.4MB
k8s.gcr.io/kube-proxy                     v1.20.2              43154ddb57a83       49.5MB
k8s.gcr.io/kube-scheduler                 v1.20.2              ed2c44fbdd78b       14MB
k8s.gcr.io/pause                          3.2                  80d28bedfe5de       300kB

Docker wo/CRI (docker images)

REPOSITORY                                TAG        IMAGE ID       CREATED         SIZE
busybox                                   latest     a9d583973f65   2 weeks ago     1.23MB
alpine                                    latest     28f6e2705743   5 weeks ago     5.61MB
k8s.gcr.io/kube-proxy                     v1.20.2    43154ddb57a8   2 months ago    118MB
k8s.gcr.io/kube-controller-manager        v1.20.2    a27166429d98   2 months ago    116MB
k8s.gcr.io/kube-apiserver                 v1.20.2    a8c2fdb8bf76   2 months ago    122MB
k8s.gcr.io/kube-scheduler                 v1.20.2    ed2c44fbdd78   2 months ago    46.4MB
kubernetesui/dashboard                    v2.1.0     9a07b5b4bfac   3 months ago    226MB
gcr.io/k8s-minikube/storage-provisioner   v4         85069258b98a   3 months ago    29.7MB
k8s.gcr.io/etcd                           3.4.13-0   0369cf4303ff   7 months ago    253MB
k8s.gcr.io/coredns                        1.7.0      bfe3a36ebd25   9 months ago    45.2MB
kubernetesui/metrics-scraper              v1.0.4     86262685d9ab   12 months ago   36.9MB
k8s.gcr.io/pause                          3.2        80d28bedfe5d   13 months ago   683kB

Docker w/CRI (sudo crictl images)

IMAGE                                     TAG                 IMAGE ID            SIZE
alpine                                    latest              28f6e27057430       5.61MB
busybox                                   latest              a9d583973f65a       1.23MB
gcr.io/k8s-minikube/storage-provisioner   v4                  85069258b98ac       29.7MB
k8s.gcr.io/coredns                        1.7.0               bfe3a36ebd252       45.2MB
k8s.gcr.io/etcd                           3.4.13-0            0369cf4303ffd       253MB
k8s.gcr.io/kube-apiserver                 v1.20.2             a8c2fdb8bf76e       122MB
k8s.gcr.io/kube-controller-manager        v1.20.2             a27166429d98e       116MB
k8s.gcr.io/kube-proxy                     v1.20.2             43154ddb57a83       118MB
k8s.gcr.io/kube-scheduler                 v1.20.2             ed2c44fbdd78b       46.4MB
k8s.gcr.io/pause                          3.2                 80d28bedfe5de       683kB
kubernetesui/dashboard                    v2.1.0              9a07b5b4bfac0       226MB
kubernetesui/metrics-scraper              v1.0.4              86262685d9abb       36.9MB

@afbjorklund
Copy link
Collaborator Author

WDYT, @medyagh

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 26, 2021

Notice the total lack of standards, when it comes to naming images and reporting sizes.

https://github.com/kubernetes/cri-api/tree/master/pkg/apis/runtime/v1

It's nice that it says "name" and "size", but nothing beyond a string or a number...

It can be short name or long name, compressed size or uncompressed size

@afbjorklund
Copy link
Collaborator Author

One feature that was suggested, was to be able to filter which images were added by kubeadm:

$ minikube ssh -- sudo /var/lib/minikube/binaries/v1.20.2/kubeadm config images list --kubernetes-version=v1.20.2
k8s.gcr.io/kube-apiserver:v1.20.2
k8s.gcr.io/kube-controller-manager:v1.20.2
k8s.gcr.io/kube-scheduler:v1.20.2
k8s.gcr.io/kube-proxy:v1.20.2
k8s.gcr.io/pause:3.2
k8s.gcr.io/etcd:3.4.13-0
k8s.gcr.io/coredns:1.7.0

As opposed to which were added by minikube by default, and which were added by the user:

$ minikube ssh -- sudo crictl images --digests
IMAGE                                     TAG                 DIGEST              IMAGE ID            SIZE
alpine                                    latest              <none>              28f6e27057430       5.61MB
busybox                                   latest              <none>              a9d583973f65a       1.23MB
gcr.io/k8s-minikube/storage-provisioner   v4                  06f83c679a723       85069258b98ac       29.7MB
k8s.gcr.io/coredns                        1.7.0               73ca82b4ce829       bfe3a36ebd252       45.2MB
k8s.gcr.io/etcd                           3.4.13-0            4ad90a11b5531       0369cf4303ffd       253MB
k8s.gcr.io/kube-apiserver                 v1.20.2             465ba895d578f       a8c2fdb8bf76e       122MB
k8s.gcr.io/kube-controller-manager        v1.20.2             842a071d4ad49       a27166429d98e       116MB
k8s.gcr.io/kube-proxy                     v1.20.2             326fe8a4508a5       43154ddb57a83       118MB
k8s.gcr.io/kube-scheduler                 v1.20.2             304b3d70497bd       ed2c44fbdd78b       46.4MB
k8s.gcr.io/pause                          3.2                 927d98197ec11       80d28bedfe5de       683kB
kubernetesui/dashboard                    v2.1.0              7f80b5ba141be       9a07b5b4bfac0       226MB
kubernetesui/metrics-scraper              v1.0.4              555981a24f184       86262685d9abb       36.9MB

@afbjorklund
Copy link
Collaborator Author

We also need to fix the short names, so that they show proper images (with the registry):

docker.io/library/alpine:latest
docker.io/library/busybox:latest
docker.io/kubernetesui/dashboard:v2.1.0
docker.io/kubernetesui/metrics-scraper:v1.0.4

So that we can get away from hardcoding docker.io, see container image short names

@afbjorklund
Copy link
Collaborator Author

This exposes a shortcoming with the current image load, when running with cri-o:

docker

k8s.gcr.io/pause:3.2
k8s.gcr.io/kube-scheduler:v1.20.2
k8s.gcr.io/kube-proxy:v1.20.2
k8s.gcr.io/kube-controller-manager:v1.20.2
k8s.gcr.io/kube-apiserver:v1.20.2
k8s.gcr.io/etcd:3.4.13-0
k8s.gcr.io/coredns:1.7.0
gcr.io/k8s-minikube/storage-provisioner:v5
docker.io/library/busybox:latest
docker.io/library/alpine:latest
docker.io/kubernetesui/metrics-scraper:v1.0.4
docker.io/kubernetesui/dashboard:v2.1.0

containerd

k8s.gcr.io/pause:3.2
k8s.gcr.io/kube-scheduler:v1.20.2
k8s.gcr.io/kube-proxy:v1.20.2
k8s.gcr.io/kube-controller-manager:v1.20.2
k8s.gcr.io/kube-apiserver:v1.20.2
k8s.gcr.io/etcd:3.4.13-0
k8s.gcr.io/coredns:1.7.0
gcr.io/k8s-minikube/storage-provisioner:v5
docker.io/library/busybox:latest
docker.io/library/alpine:latest
docker.io/kubernetesui/metrics-scraper:v1.0.4
docker.io/kubernetesui/dashboard:v2.1.0
docker.io/kindest/kindnetd:v20210220-5b7e6d01

cri-o

localhost/busybox:latest
localhost/alpine:latest
k8s.gcr.io/pause:3.2
k8s.gcr.io/kube-scheduler:v1.20.2
k8s.gcr.io/kube-proxy:v1.20.2
k8s.gcr.io/kube-controller-manager:v1.20.2
k8s.gcr.io/kube-apiserver:v1.20.2
k8s.gcr.io/etcd:3.4.13-0
k8s.gcr.io/coredns:1.7.0
gcr.io/k8s-minikube/storage-provisioner:v5
docker.io/kubernetesui/metrics-scraper:v1.0.4
docker.io/kubernetesui/dashboard:v2.1.0
docker.io/kindest/kindnetd:v20210220-5b7e6d01

This is a known issue, podman only adds fully qualified names.

@afbjorklund
Copy link
Collaborator Author

You can compare this output, with the regular crictl images from above.

Main differences:

  • repository/tag only
  • sorting (reverse)
  • qualified names

The other output formats (like JSON) could be added, with some effort.

Also the output for containerd needs fixing, to show unpacked sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant