Add support for Helm v3 and containerized armada

This removes helm initialization that works with v2 only.
This adds an armada manifest to configure node labels on controllers.

Change-Id: I7547fb1184352cc7ab6d4c001bac21f73e429de7
Story: 2007000
Task: 39323
Depends-On: https://review.opendev.org/719962
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
This commit is contained in:
Jim Gauld 2020-04-08 15:21:27 -04:00
parent 3d48bb182e
commit 4005411fac
3 changed files with 27 additions and 10 deletions

View File

@ -45,6 +45,7 @@ include ::platform::dockerdistribution
include ::platform::containerd::controller
include ::platform::kubernetes::master
include ::platform::helm
include ::platform::armada
include ::platform::patching
include ::platform::patching::api

View File

@ -0,0 +1,25 @@
class platform::armada::params(
$node_selector_label = 'armada=enabled'
) {}
class platform::armada
inherits ::platform::armada::params {
include ::platform::params
if (str2bool($::is_initial_config) and $::personality == 'controller') {
Class['::platform::kubernetes::master']
# Configure sane node label values that work with armada node selector.
# This is a workaround for helm v3 increased chart validation of values.
# We cannot override armada .Values.labels.node_selector_value with null
# or "" since it produces:
# error validating "": error validating data: unknown object type "nil".
# We can override with "" if the chart is modified to quote the value.
-> exec { 'label for armada node selector':
path => '/usr/bin:/usr/sbin:/bin',
command => "kubectl --kubeconfig=/etc/kubernetes/admin.conf label node ${::platform::params::hostname} armada=enabled || true", # lint:ignore:140chars
logoutput => true,
}
}
}

View File

@ -24,7 +24,7 @@ define platform::helm::repository (
command => "helm repo index ${repo_path}",
logoutput => true,
user => 'www',
group => 'www',
group => 'root',
require => User['www'],
}
@ -95,15 +95,6 @@ class platform::helm
Class['::platform::kubernetes::master']
-> exec { 'initialize helm':
environment => [ 'KUBECONFIG=/etc/kubernetes/admin.conf', 'HOME=/home/sysadmin' ],
command => 'helm init --skip-refresh --client-only',
logoutput => true,
user => 'sysadmin',
group => 'sys_protected',
require => User['sysadmin']
}
-> exec { 'restart lighttpd for helm':
require => [File['/etc/lighttpd/lighttpd.conf', $target_helm_repos_base_dir, $source_helm_repos_base_dir]],
command => 'systemctl restart lighttpd.service',