From 25c080f6af72145e05f28cd0c769b3df790fd118 Mon Sep 17 00:00:00 2001 From: Ryan Rotter Date: Fri, 13 Oct 2023 19:48:56 -0400 Subject: [PATCH] configure containerd --- manifests/profile/containerd.pp | 5 +++++ spec/classes/profile/containerd_spec.rb | 2 ++ templates/profile/containerd/config.toml.erb | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 templates/profile/containerd/config.toml.erb diff --git a/manifests/profile/containerd.pp b/manifests/profile/containerd.pp index 0de1efced..d283384d2 100644 --- a/manifests/profile/containerd.pp +++ b/manifests/profile/containerd.pp @@ -24,4 +24,9 @@ src => false, }, } + + file { "/etc/containerd/config.toml": + content => template('nebula/profile/containerd/config.toml.erb'), + notify => Service['containerd'] + } } diff --git a/spec/classes/profile/containerd_spec.rb b/spec/classes/profile/containerd_spec.rb index 07572c505..40334e6b4 100644 --- a/spec/classes/profile/containerd_spec.rb +++ b/spec/classes/profile/containerd_spec.rb @@ -14,6 +14,8 @@ it { is_expected.to contain_apt__source('docker') } it { is_expected.to contain_package('containerd.io').that_requires('Apt::Source[docker]') } it { is_expected.to contain_service('containerd').that_requires('Package[containerd.io]') } + it { is_expected.to contain_file('/etc/containerd/config.toml').with_content(/^disabled_plugins = \[\]$/) } + it { is_expected.to contain_file('/etc/containerd/config.toml').with_content(/^SystemdCgroup = true$/) } end end end diff --git a/templates/profile/containerd/config.toml.erb b/templates/profile/containerd/config.toml.erb new file mode 100644 index 000000000..4a054ce71 --- /dev/null +++ b/templates/profile/containerd/config.toml.erb @@ -0,0 +1,3 @@ +disabled_plugins = [] +[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] +SystemdCgroup = true