Puppet Class: containerd::configuration
- Defined in:
- modules/containerd/manifests/configuration.pp
Summary
Configure containerdOverview
SPDX-License-Identifier: Apache-2.0
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'modules/containerd/manifests/configuration.pp', line 24
class containerd::configuration (
Wmflib::Ensure $ensure = present,
String $sandbox_image = 'docker-registry.discovery.wmnet/pause:3.6-1',
Boolean $dragonfly_enabled = false,
Optional[String] $registry_username = undef,
Optional[String] $registry_password = undef,
Hash[String, Hash[String, String]] $runsc_config = {},
) {
file { '/etc/containerd':
ensure => stdlib::ensure($ensure, 'directory'),
owner => 'root',
group => 'root',
mode => '0755',
}
if $registry_username and $registry_password {
# uses strict_encode64 since encode64 adds newlines?!
$registry_auth = inline_template("<%= require 'base64'; Base64.strict_encode64('${registry_username}:${registry_password}') -%>")
} else {
$registry_auth = undef
}
# On Trixie containerd runs with a different cni bin dir default: /usr/lib/cni
# Our calico debian packages deploy the calico binaries to /opt/cni/bin.
if debian::codename::ge('trixie') {
$cni_bin_dir = '/opt/cni/bin'
} else {
$cni_bin_dir = undef
}
file { '/etc/containerd/config.toml':
ensure => stdlib::ensure($ensure, 'file'),
owner => 'root',
group => 'root',
mode => '0440',
content => template('containerd/containerd-config.toml.erb'),
notify => Service['containerd'],
}
$runsc_config.each |$label, $config| {
file { "/etc/containerd/runsc-${label}.toml":
ensure => stdlib::ensure($ensure, 'file'),
owner => 'root',
group => 'root',
mode => '0440',
content => template('containerd/runsc-config.toml.erb'),
notify => Service['containerd'],
}
}
}
|