Merge "Add proxyconfig class for containerd"
This commit is contained in:
commit
7288888d4d
|
@ -10,21 +10,10 @@ class platform::containerd::params (
|
||||||
$custom_container_runtime = undef,
|
$custom_container_runtime = undef,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
class platform::containerd::config
|
class platform::containerd::proxyconfig{
|
||||||
inherits ::platform::containerd::params {
|
|
||||||
|
|
||||||
include ::platform::docker::params
|
include ::platform::docker::params
|
||||||
include ::platform::dockerdistribution::params
|
include ::platform::containerd::install
|
||||||
include ::platform::kubernetes::params
|
|
||||||
include ::platform::dockerdistribution::registries
|
|
||||||
include ::platform::params
|
|
||||||
include ::platform::mtce::params
|
|
||||||
|
|
||||||
# If containerd is started prior to networking providing a default route, the
|
|
||||||
# containerd cri plugin will fail to load and the status of the cri plugin
|
|
||||||
# will be in 'error'. This will prevent any crictl image pulls from working as
|
|
||||||
# containerd is not automatically restarted when plugins fail to load.
|
|
||||||
Anchor['platform::networking'] -> Class[$name]
|
|
||||||
|
|
||||||
# inherit the proxy setting from docker
|
# inherit the proxy setting from docker
|
||||||
$http_proxy = $::platform::docker::params::http_proxy
|
$http_proxy = $::platform::docker::params::http_proxy
|
||||||
|
@ -35,11 +24,6 @@ class platform::containerd::config
|
||||||
# remove the square brackets
|
# remove the square brackets
|
||||||
$no_proxy = regsubst($::platform::docker::params::no_proxy, '\\[|\\]', '', 'G')
|
$no_proxy = regsubst($::platform::docker::params::no_proxy, '\\[|\\]', '', 'G')
|
||||||
}
|
}
|
||||||
$insecure_registries = $::platform::dockerdistribution::registries::insecure_registries
|
|
||||||
$distributed_cloud_role = $::platform::params::distributed_cloud_role
|
|
||||||
|
|
||||||
# grab custom cri class entries
|
|
||||||
$custom_container_runtime = $::platform::containerd::params::custom_container_runtime
|
|
||||||
|
|
||||||
if $http_proxy or $https_proxy {
|
if $http_proxy or $https_proxy {
|
||||||
file { '/etc/systemd/system/containerd.service.d':
|
file { '/etc/systemd/system/containerd.service.d':
|
||||||
|
@ -63,6 +47,38 @@ class platform::containerd::config
|
||||||
} ~> Service['containerd']
|
} ~> Service['containerd']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service { 'containerd':
|
||||||
|
ensure => 'running',
|
||||||
|
name => 'containerd',
|
||||||
|
enable => true,
|
||||||
|
require => Package['containerd']
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class platform::containerd::config
|
||||||
|
inherits ::platform::containerd::params {
|
||||||
|
|
||||||
|
include ::platform::containerd::proxyconfig
|
||||||
|
include ::platform::docker::params
|
||||||
|
include ::platform::dockerdistribution::params
|
||||||
|
include ::platform::kubernetes::params
|
||||||
|
include ::platform::dockerdistribution::registries
|
||||||
|
include ::platform::params
|
||||||
|
include ::platform::mtce::params
|
||||||
|
|
||||||
|
# If containerd is started prior to networking providing a default route, the
|
||||||
|
# containerd cri plugin will fail to load and the status of the cri plugin
|
||||||
|
# will be in 'error'. This will prevent any crictl image pulls from working as
|
||||||
|
# containerd is not automatically restarted when plugins fail to load.
|
||||||
|
Anchor['platform::networking'] -> Class[$name]
|
||||||
|
|
||||||
|
$insecure_registries = $::platform::dockerdistribution::registries::insecure_registries
|
||||||
|
$distributed_cloud_role = $::platform::params::distributed_cloud_role
|
||||||
|
|
||||||
|
# grab custom cri class entries
|
||||||
|
$custom_container_runtime = $::platform::containerd::params::custom_container_runtime
|
||||||
|
|
||||||
Class['::platform::filesystem::docker'] ~> Class[$name]
|
Class['::platform::filesystem::docker'] ~> Class[$name]
|
||||||
|
|
||||||
# get cni bin directory
|
# get cni bin directory
|
||||||
|
@ -93,12 +109,7 @@ class platform::containerd::config
|
||||||
mode => '0600',
|
mode => '0600',
|
||||||
content => template('platform/config.toml.erb'),
|
content => template('platform/config.toml.erb'),
|
||||||
}
|
}
|
||||||
-> service { 'containerd':
|
-> Service['containerd']
|
||||||
ensure => 'running',
|
|
||||||
name => 'containerd',
|
|
||||||
enable => true,
|
|
||||||
require => Package['containerd']
|
|
||||||
}
|
|
||||||
-> exec { 'enable-containerd':
|
-> exec { 'enable-containerd':
|
||||||
command => '/usr/bin/systemctl enable containerd.service',
|
command => '/usr/bin/systemctl enable containerd.service',
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,6 +165,7 @@ ${::platform::dockerdistribution::params::registry_password}&"
|
||||||
class platform::docker::runtime
|
class platform::docker::runtime
|
||||||
{
|
{
|
||||||
include ::platform::docker::proxyconfig
|
include ::platform::docker::proxyconfig
|
||||||
|
include ::platform::containerd::proxyconfig
|
||||||
|
|
||||||
if str2bool($::is_initial_config) {
|
if str2bool($::is_initial_config) {
|
||||||
$containerd_restart_cmd = 'systemctl restart containerd'
|
$containerd_restart_cmd = 'systemctl restart containerd'
|
||||||
|
|
Loading…
Reference in New Issue