2021-04-02 14:20:11 +08:00
|
|
|
version = 2
|
2021-05-19 23:24:53 +08:00
|
|
|
root = "{{ containerd_storage_dir }}"
|
|
|
|
state = "{{ containerd_state_dir }}"
|
|
|
|
oom_score = {{ containerd_oom_score }}
|
2021-01-05 23:13:58 +08:00
|
|
|
|
2024-05-16 15:41:26 +08:00
|
|
|
{% if containerd_extra_args is defined %}
|
|
|
|
{{ containerd_extra_args }}
|
|
|
|
{% endif %}
|
|
|
|
|
2021-04-02 14:20:11 +08:00
|
|
|
[grpc]
|
2024-02-09 22:33:16 +08:00
|
|
|
max_recv_message_size = {{ containerd_grpc_max_recv_message_size }}
|
|
|
|
max_send_message_size = {{ containerd_grpc_max_send_message_size }}
|
2019-06-30 05:09:20 +08:00
|
|
|
|
|
|
|
[debug]
|
2024-08-21 12:13:05 +08:00
|
|
|
address = "{{ containerd_debug_address }}"
|
2024-02-09 22:33:16 +08:00
|
|
|
level = "{{ containerd_debug_level }}"
|
2024-08-21 12:13:05 +08:00
|
|
|
format = "{{ containerd_debug_format }}"
|
|
|
|
uid = {{ containerd_debug_uid }}
|
|
|
|
gid = {{ containerd_debug_gid }}
|
2019-06-30 05:09:20 +08:00
|
|
|
|
2021-04-02 14:20:11 +08:00
|
|
|
[metrics]
|
2024-02-09 22:33:16 +08:00
|
|
|
address = "{{ containerd_metrics_address }}"
|
|
|
|
grpc_histogram = {{ containerd_metrics_grpc_histogram | lower }}
|
2021-04-02 14:20:11 +08:00
|
|
|
|
|
|
|
[plugins]
|
|
|
|
[plugins."io.containerd.grpc.v1.cri"]
|
|
|
|
sandbox_image = "{{ pod_infra_image_repo }}:{{ pod_infra_image_tag }}"
|
|
|
|
max_container_log_line_size = {{ containerd_max_container_log_line_size }}
|
2024-02-09 22:33:16 +08:00
|
|
|
enable_unprivileged_ports = {{ containerd_enable_unprivileged_ports | lower }}
|
|
|
|
enable_unprivileged_icmp = {{ containerd_enable_unprivileged_icmp | lower }}
|
2024-08-21 12:13:05 +08:00
|
|
|
enable_selinux = {{ containerd_enable_selinux | lower }}
|
|
|
|
disable_apparmor = {{ containerd_disable_apparmor | lower }}
|
|
|
|
tolerate_missing_hugetlb_controller = {{ containerd_tolerate_missing_hugetlb_controller | lower }}
|
|
|
|
disable_hugetlb_controller = {{ containerd_disable_hugetlb_controller | lower }}
|
|
|
|
image_pull_progress_timeout = "{{ containerd_image_pull_progress_timeout }}"
|
2023-11-15 00:20:19 +08:00
|
|
|
{% if enable_cdi %}
|
|
|
|
enable_cdi = true
|
|
|
|
cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"]
|
|
|
|
{% endif %}
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd]
|
2024-02-09 22:33:16 +08:00
|
|
|
default_runtime_name = "{{ containerd_default_runtime }}"
|
|
|
|
snapshotter = "{{ containerd_snapshotter }}"
|
|
|
|
discard_unpacked_layers = {{ containerd_discard_unpacked_layers | lower }}
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
|
2022-09-21 23:33:15 +08:00
|
|
|
{% for runtime in [containerd_runc_runtime] + containerd_additional_runtimes %}
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}]
|
|
|
|
runtime_type = "{{ runtime.type }}"
|
|
|
|
runtime_engine = "{{ runtime.engine }}"
|
|
|
|
runtime_root = "{{ runtime.root }}"
|
2022-09-24 01:38:27 +08:00
|
|
|
{% if runtime.base_runtime_spec is defined %}
|
|
|
|
base_runtime_spec = "{{ containerd_cfg_dir }}/{{ runtime.base_runtime_spec }}"
|
|
|
|
{% endif %}
|
|
|
|
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}.options]
|
|
|
|
{% for key, value in runtime.options.items() %}
|
2023-10-31 00:54:31 +08:00
|
|
|
{% if value | string != "true" and value | string != "false" %}
|
|
|
|
{{ key }} = "{{ value }}"
|
|
|
|
{% else %}
|
2021-04-02 14:20:11 +08:00
|
|
|
{{ key }} = {{ value }}
|
2023-10-31 00:54:31 +08:00
|
|
|
{% endif %}
|
2019-06-30 05:09:20 +08:00
|
|
|
{% endfor %}
|
2020-02-17 18:15:29 +08:00
|
|
|
{% endfor %}
|
2020-06-22 15:28:39 +08:00
|
|
|
{% if kata_containers_enabled %}
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.kata-qemu]
|
|
|
|
runtime_type = "io.containerd.kata-qemu.v2"
|
2021-06-21 20:18:51 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if gvisor_enabled %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runsc]
|
|
|
|
runtime_type = "io.containerd.runsc.v1"
|
2020-06-22 15:28:39 +08:00
|
|
|
{% endif %}
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry]
|
2023-02-17 12:57:39 +08:00
|
|
|
{% if containerd_use_config_path is defined and containerd_use_config_path|bool %}
|
2023-01-17 15:42:32 +08:00
|
|
|
config_path = "{{ containerd_cfg_dir }}/certs.d"
|
2023-02-17 12:57:39 +08:00
|
|
|
{% else %}
|
2021-04-02 14:20:11 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
|
2023-08-16 20:18:27 +08:00
|
|
|
{% for registry in containerd_registries_mirrors %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry.prefix }}"]
|
2024-10-08 15:46:22 +08:00
|
|
|
endpoint = {{ registry.mirrors | map(attribute='host') | unique | to_json }}
|
2019-06-30 05:09:20 +08:00
|
|
|
{% endfor %}
|
2024-10-08 15:46:22 +08:00
|
|
|
{% for mirror in containerd_registries_mirrors | map(attribute='mirrors') | flatten | selectattr('skip_verify', 'defined') | selectattr('skip_verify') | unique %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ mirror.host | urlsplit('netloc') }}".tls]
|
2021-12-13 16:41:58 +08:00
|
|
|
insecure_skip_verify = true
|
|
|
|
{% endfor %}
|
2022-01-05 18:56:33 +08:00
|
|
|
{% endif %}
|
2021-08-23 21:40:00 +08:00
|
|
|
{% for registry in containerd_registry_auth if registry['registry'] is defined %}
|
|
|
|
{% if (registry['username'] is defined and registry['password'] is defined) or registry['auth'] is defined %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ registry['registry'] }}".auth]
|
|
|
|
{% if registry['username'] is defined and registry['password'] is defined %}
|
|
|
|
password = "{{ registry['password'] }}"
|
|
|
|
username = "{{ registry['username'] }}"
|
|
|
|
{% else %}
|
|
|
|
auth = "{{ registry['auth'] }}"
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2021-04-12 16:02:00 +08:00
|
|
|
|
2023-11-15 23:06:42 +08:00
|
|
|
{% if nri_enabled and containerd_version is version('1.7.0', '>=') %}
|
2023-09-21 15:30:19 +08:00
|
|
|
[plugins."io.containerd.nri.v1.nri"]
|
Refactor NRI activation for containerd and CRI-O (#10470)
Refactor NRI (Node Resource Interface) activation in CRI-O and
containerd. Introduce a shared variable, nri_enabled, to streamline
the process. Currently, enabling NRI requires a separate update of
defaults for each container runtime independently, without any
verification of NRI support for the specific version of containerd
or CRI-O in use.
With this commit, the previous approach is replaced. Now, a single
variable, nri_enabled, handles this functionality. Also, this commit
separates the responsibility of verifying NRI supported versions of
containerd and CRI-O from cluster administrators, and leaves it to
Ansible.
Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
2023-09-26 23:05:25 +08:00
|
|
|
disable = false
|
|
|
|
{% endif %}
|
2023-09-21 15:30:19 +08:00
|
|
|
|
2024-04-23 15:24:19 +08:00
|
|
|
{% if containerd_tracing_enabled %}
|
|
|
|
[plugins."io.containerd.tracing.processor.v1.otlp"]
|
|
|
|
endpoint = "{{ containerd_tracing_endpoint }}"
|
|
|
|
protocol = "{{ containerd_tracing_protocol }}"
|
2024-07-26 16:30:38 +08:00
|
|
|
{% if containerd_tracing_protocol == "grpc" %}
|
2024-04-23 15:24:19 +08:00
|
|
|
insecure = false
|
2024-07-26 16:30:38 +08:00
|
|
|
{% endif %}
|
2024-04-23 15:24:19 +08:00
|
|
|
[plugins."io.containerd.internal.v1.tracing"]
|
|
|
|
sampling_ratio = {{ containerd_tracing_sampling_ratio }}
|
|
|
|
service_name = "{{ containerd_tracing_service_name }}"
|
|
|
|
{% endif %}
|