From e0195da80d158d65f55330b39868c64e72fb1496 Mon Sep 17 00:00:00 2001 From: Florian Ruynat <16313165+floryut@users.noreply.github.com> Date: Tue, 5 Jan 2021 16:13:58 +0100 Subject: [PATCH] Allow containerd root and state path to be configured (#7098) --- roles/container-engine/containerd/defaults/main.yml | 5 +++++ roles/container-engine/containerd/templates/config.toml.j2 | 5 +++++ tests/files/packet_centos7-flannel-containerd-addons-ha.yml | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/roles/container-engine/containerd/defaults/main.yml b/roles/container-engine/containerd/defaults/main.yml index 871994337..b512b0da3 100644 --- a/roles/container-engine/containerd/defaults/main.yml +++ b/roles/container-engine/containerd/defaults/main.yml @@ -1,4 +1,9 @@ --- +# The root directory for containerd metadata +containerd_metadata_root_dir: /var/lib/containerd +# The state directory for containerd +containerd_state_dir: /run/containerd + containerd_config: grpc: max_recv_message_size: 16777216 diff --git a/roles/container-engine/containerd/templates/config.toml.j2 b/roles/container-engine/containerd/templates/config.toml.j2 index e2cc50bbf..9ed28ef53 100644 --- a/roles/container-engine/containerd/templates/config.toml.j2 +++ b/roles/container-engine/containerd/templates/config.toml.j2 @@ -1,3 +1,8 @@ +# persistent data location +root = "{{ containerd_metadata_root_dir }}" +# runtime state information +state = "{{ containerd_state_dir }}" + # Kubernetes doesn't use containerd restart manager. disabled_plugins = ["restart"] diff --git a/tests/files/packet_centos7-flannel-containerd-addons-ha.yml b/tests/files/packet_centos7-flannel-containerd-addons-ha.yml index fa5fff1a7..88bd92def 100644 --- a/tests/files/packet_centos7-flannel-containerd-addons-ha.yml +++ b/tests/files/packet_centos7-flannel-containerd-addons-ha.yml @@ -38,3 +38,7 @@ tls_cipher_suites: etcd_tls_cipher_suites: - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + +# Containerd path +containerd_metadata_root_dir: /var/data/containerd +containerd_state_dir: /run/cri/containerd