mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-04 08:48:42 +03:00
Disable discard_unpacked_layers for containerd >= 2.1 (#12821)
Only set `discard_unpacked_layers` in the CRI image config for containerd versions earlier than 2.1.0. Starting with containerd v2.1, the CRI plugin uses the Transfer Service for image pulls by default. The `discard_unpacked_layers` option is incompatible with the Transfer Service and triggers containerd to fall back to local image pulls, logging a warning. This change prevents unsupported configuration from being applied on newer containerd versions, avoiding runtime warnings and ensuring default image pull behavior. Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
This commit is contained in:
@@ -35,8 +35,8 @@ containerd_default_base_runtime_spec_patch:
|
|||||||
hard: "{{ containerd_base_runtime_spec_rlimit_nofile }}"
|
hard: "{{ containerd_base_runtime_spec_rlimit_nofile }}"
|
||||||
soft: "{{ containerd_base_runtime_spec_rlimit_nofile }}"
|
soft: "{{ containerd_base_runtime_spec_rlimit_nofile }}"
|
||||||
|
|
||||||
# Can help reduce disk usage
|
# Only for containerd < 2.1; discard unpacked layers to save disk space
|
||||||
# https://github.com/containerd/containerd/discussions/6295
|
# https://github.com/containerd/containerd/blob/release/2.1/docs/cri/config.md#image-pull-configuration-since-containerd-v21
|
||||||
containerd_discard_unpacked_layers: true
|
containerd_discard_unpacked_layers: true
|
||||||
|
|
||||||
containerd_base_runtime_specs:
|
containerd_base_runtime_specs:
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ oom_score = {{ containerd_oom_score }}
|
|||||||
|
|
||||||
[plugins."io.containerd.cri.v1.images"]
|
[plugins."io.containerd.cri.v1.images"]
|
||||||
snapshotter = "{{ containerd_snapshotter }}"
|
snapshotter = "{{ containerd_snapshotter }}"
|
||||||
|
{% if containerd_discard_unpacked_layers and containerd_version is version('2.1.0', '<') %}
|
||||||
discard_unpacked_layers = {{ containerd_discard_unpacked_layers | lower }}
|
discard_unpacked_layers = {{ containerd_discard_unpacked_layers | lower }}
|
||||||
|
{% endif %}
|
||||||
image_pull_progress_timeout = "{{ containerd_image_pull_progress_timeout }}"
|
image_pull_progress_timeout = "{{ containerd_image_pull_progress_timeout }}"
|
||||||
[plugins."io.containerd.cri.v1.images".pinned_images]
|
[plugins."io.containerd.cri.v1.images".pinned_images]
|
||||||
sandbox = "{{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
|
sandbox = "{{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user