Skip to content

ctr image export fails when discard_unpacked_layers=true is enabled #9277

Closed as not planned

Description

@2rigor

Description

When GC layers optimization is enabled (discard_unpacked_layers=true) some/all layers may be missing from containerd content storage.
Thus ctr image export fails to export image. Can CLI be fixed to export image content? Practically the content is present on the disk

Steps to reproduce the issue

  1. Install K8s with containerd
  2. enable discard_unpacked_layers=true in /etc/containerd/config.toml
    Alternatively you may create e.g. GKE 1.27
  3. list images using sudo ctr -n k8s.io image ls, choose some image. Instead run pod with some image e.g. alpine:latest
  4. sudo ctr -n k8s.io image export - <image_ref> e.g. sudo ctr -n k8s.io image export - docker.io/library/alpine:latest

Describe the results you received and expected

You will get error:
ctr: failed to get reader: content digest sha256:<..>: not found

Expected - get image tar file.

What version of containerd are you using?

containerd containerd.io 1.6.24 61f9fd8

Any other relevant information

If it won't be fixed, what is the suggested approach to get the image content?

Show configuration if it is related to CRI plugin.

cat /etc/containerd/config.toml | grep discarc -C 3

[plugins."io.containerd.grpc.v1.cri".containerd]
  default_runtime_name = "runc"
  disable_snapshot_annotations = true
  **discard_unpacked_layers = true**
  ignore_rdt_not_enabled_errors = false
  no_pivot = false
  snapshotter = "overlayfs"

Activity

  1. hellt commented on Feb 21, 2024

    @hellt

    We are also looking for a solution to this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions