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
|
|
|
|
2021-04-02 14:20:11 +08:00
|
|
|
[grpc]
|
|
|
|
max_recv_message_size = {{ containerd_grpc_max_recv_message_size | default(16777216) }}
|
|
|
|
max_send_message_size = {{ containerd_grpc_max_send_message_size | default(16777216) }}
|
2019-06-30 05:09:20 +08:00
|
|
|
|
|
|
|
[debug]
|
2021-04-02 14:20:11 +08:00
|
|
|
level = "{{ containerd_debug_level | default('info') }}"
|
2019-06-30 05:09:20 +08:00
|
|
|
|
2021-04-02 14:20:11 +08:00
|
|
|
[metrics]
|
|
|
|
address = "{{ containerd_metrics_address | default('') }}"
|
|
|
|
grpc_histogram = {{ containerd_metrics_grpc_histogram | default(false) | lower }}
|
|
|
|
|
|
|
|
[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 }}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd]
|
|
|
|
default_runtime_name = "{{ containerd_default_runtime | default('runc') }}"
|
|
|
|
snapshotter = "{{ containerd_snapshotter | default('overlayfs') }}"
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
|
2021-11-05 22:59:54 +08:00
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ containerd_runc_runtime.name }}]
|
|
|
|
runtime_type = "{{ containerd_runc_runtime.type }}"
|
|
|
|
runtime_engine = "{{ containerd_runc_runtime.engine}}"
|
|
|
|
runtime_root = "{{ containerd_runc_runtime.root }}"
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ containerd_runc_runtime.name }}.options]
|
|
|
|
{% for key, value in containerd_runc_runtime.options.items() %}
|
|
|
|
{{ key }} = {{ value }}
|
|
|
|
{% endfor %}
|
|
|
|
{% for runtime in 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 }}"
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.{{ runtime.name }}.options]
|
|
|
|
{% for key, value in runtime.options.items() %}
|
|
|
|
{{ key }} = {{ value }}
|
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]
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
|
|
|
|
{% for registry, addr in containerd_registries.items() %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"]
|
|
|
|
endpoint = ["{{ ([ addr ] | flatten ) | join('","') }}"]
|
2019-06-30 05:09:20 +08:00
|
|
|
{% endfor %}
|
2022-01-05 18:56:33 +08:00
|
|
|
{% if containerd_insecure_registries is defined and containerd_insecure_registries|length>0 %}
|
|
|
|
{% for registry, addr in containerd_insecure_registries.items() %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ registry }}"]
|
2021-12-13 16:41:58 +08:00
|
|
|
endpoint = ["{{ ([ addr ] | flatten ) | join('","') }}"]
|
2022-08-23 14:13:23 +08:00
|
|
|
{% endfor %}
|
|
|
|
{% for addr in containerd_insecure_registries.values() | flatten | unique %}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.configs."{{ addr }}".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
|
|
|
|
|
|
|
{% if containerd_extra_args is defined %}
|
|
|
|
{{ containerd_extra_args }}
|
|
|
|
{% endif %}
|