Skip to content

crictl shows the compressed size, and is inconsistent with docker images #120698

@mfranzil

Description

@mfranzil

What happened?

Running crictl images (latest version) shows the compressed size of each image, which is both misleading and inconsistent with docker images, which instead shows the uncompressed size.

See kubernetes-sigs/cri-tools#1264; the inconsistency happens because in the CRI-API there is no reference on which size (blob or uncompressed) should be shown by the runtime.

Using the blob size is misleading as it may trick users into thinking images are using less disk space than they are in reality.

What did you expect to happen?

The CRI-API needs to decide which size to handle (blob/compressed, i.e. the size of images as stored in the registry and as transferred over the network; uncompressed, i.e., the actual size once images have been gunzip-ped) and enforce that for each runtime.

How can we reproduce it (as minimally and precisely as possible)?

Assume I download the latest nginx image. Running a simple pod and inspecting the contents of the image cache with crictl yields:

IMAGE                                  TAG                 IMAGE ID            SIZE
docker.io/library/nginx                latest              f5a6b296b8a29       70.5MB
[...]

Downloading the exact image with docker pull on the same machine and running docker images yields:

REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
nginx        latest    f5a6b296b8a2   5 days ago   187MB

crictl shows the compressed size, while docker images shows the uncompressed (on disk) size.

Anything else we need to know?

See discussion on issue kubernetes-sigs/cri-tools#1264 for further details.

Kubernetes version

$ kubectl version -o yaml
clientVersion:
  buildDate: "2023-04-14T13:21:19Z"
  compiler: gc
  gitCommit: 4c9411232e10168d7b050c49a1b59f6df9d7ea4b
  gitTreeState: clean
  gitVersion: v1.27.1
  goVersion: go1.20.3
  major: "1"
  minor: "27"
  platform: linux/amd64
kustomizeVersion: v5.0.1
serverVersion:
  buildDate: "2023-08-24T00:42:11Z"
  compiler: gc
  gitCommit: 93e0d7146fb9c3e9f68aa41b2b4265b2fcdb0a4c
  gitTreeState: clean
  gitVersion: v1.27.5
  goVersion: go1.20.7
  major: "1"
  minor: "27"
  platform: linux/amd64

Cloud provider

Private cloud

OS version

  • OS (e.g: cat /etc/os-release):
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • Kernel (e.g. uname -a):
Linux worker2 5.4.0-146-generic #163-Ubuntu SMP Fri Mar 17 18:26:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Install tools

None.

Container runtime (CRI) and version (if applicable)

  • crictl version
Version:  0.1.0
RuntimeName:  containerd
RuntimeVersion:  1.6.22
RuntimeApiVersion:  v1
  • crictl --version
crictl version v1.28.0

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/documentationCategorizes issue or PR as related to documentation.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.sig/nodeCategorizes an issue or PR as relevant to SIG Node.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions