Docker Registry Can't Deploy On Workers

The flag marking the registry as "insecure" is missing on the computes.
This creates certificate issues and fails deployments on computes when
using images from the local Docker registry. This commit adds the
"insecure" flag to mark the registry as insecure on the compute nodes.
This will go away once proper authentication is implemented for
Docker registry.

Story: 2004520
Task: 28312

Change-Id: Ib8d9fad435eda85e1eaebc5fd71b0ff3d60f3dd8
Signed-off-by: Jerry Sun <jerry.sun@windriver.com>
This commit is contained in:
Jerry Sun 2018-12-17 16:13:23 -05:00 committed by jerry
parent 487669565a
commit eaab7d2c08
2 changed files with 30 additions and 0 deletions

View File

@ -32,6 +32,7 @@ include ::platform::grub
include ::platform::collectd
include ::platform::filesystem::compute
include ::platform::docker
include ::platform::dockerdistribution::compute
include ::platform::kubernetes::worker
include ::platform::multipath
include ::platform::client

View File

@ -44,6 +44,35 @@ class platform::dockerdistribution::config
}
}
# compute also needs the "insecure" flag in order to deploy images from
# the registry. This will go away when proper authentication is implemented
class platform::dockerdistribution::compute
inherits ::platform::dockerdistribution::params {
include ::platform::kubernetes::params
$enabled = $::platform::kubernetes::params::enabled
if $enabled {
include ::platform::network::mgmt::params
$docker_registry_ip = $::platform::network::mgmt::params::controller_address
# currently docker registry is running insecure mode
# when proper authentication is implemented, this would go away
file { "/etc/docker":
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0700',
} ->
file { "/etc/docker/daemon.json":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
content => template('platform/insecuredockerregistry.conf.erb'),
}
}
}
class platform::dockerdistribution
inherits ::platform::dockerdistribution::params {