feat: moderate the k8s install (#403)
- only install a base config - wait for 3 masters before deploying helm charts - remove cluster-domain - manage nginx ingres via rke2 helmconfig Reviewed-on: #403
This commit was merged in pull request #403.
This commit is contained in:
@@ -7,13 +7,6 @@ class rke2::config (
|
||||
Stdlib::Fqdn $bootstrap_node = $rke2::bootstrap_node,
|
||||
String $node_token = $rke2::node_token,
|
||||
Array[String[1]] $extra_config_files = $rke2::extra_config_files,
|
||||
Boolean $csi_ceph_enable = $rke2::csi_ceph_enable,
|
||||
Array[String] $csi_ceph_files = $rke2::csi_ceph_files,
|
||||
Array[String] $csi_ceph_templates = $rke2::csi_ceph_templates,
|
||||
Optional[String[1]] $csi_ceph_key = $rke2::csi_ceph_key,
|
||||
Optional[String[1] ] $csi_ceph_clusterid = $rke2::csi_ceph_clusterid,
|
||||
Optional[Array[String]] $csi_ceph_monitors = $rke2::csi_ceph_monitors,
|
||||
Optional[String[1]] $csi_ceph_poolname = $rke2::csi_ceph_poolname,
|
||||
){
|
||||
|
||||
# if its not the bootstrap node, add join path to config
|
||||
@@ -24,9 +17,7 @@ class rke2::config (
|
||||
token => $node_token,
|
||||
} )
|
||||
}else{
|
||||
$config = merge($config_hash, {
|
||||
token => $node_token,
|
||||
} )
|
||||
$config = merge($config_hash, {})
|
||||
}
|
||||
} elsif $node_type == 'agent' {
|
||||
$config = merge($config_hash, {
|
||||
@@ -75,7 +66,7 @@ class rke2::config (
|
||||
}
|
||||
|
||||
# on the controller nodes only
|
||||
if $node_type == 'server' {
|
||||
if $node_type == 'server' and $facts['k8s_masters'] and $facts['k8s_masters'] > 2 {
|
||||
|
||||
# wait for purelb helm to setup namespace
|
||||
if 'purelb' in $facts['k8s_namespaces'] {
|
||||
@@ -114,32 +105,5 @@ class rke2::config (
|
||||
}
|
||||
}
|
||||
|
||||
# manage ceph files
|
||||
if $csi_ceph_enable {
|
||||
|
||||
$csi_ceph_files.each |$file| {
|
||||
|
||||
file {"/var/lib/rancher/rke2/server/manifests/${file}.yaml":
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => "puppet:///modules/rke2/${file}.yaml",
|
||||
require => Service['rke2-server'],
|
||||
}
|
||||
}
|
||||
|
||||
$csi_ceph_templates.each |$file| {
|
||||
|
||||
file {"/var/lib/rancher/rke2/server/manifests/${file}.yaml":
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template("rke2/${file}.yaml.erb"),
|
||||
require => Service['rke2-server'],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ class rke2::helm (
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
# on the controller nodes only
|
||||
if $node_type == 'server' {
|
||||
# on the controller nodes only, and after 3 master nodes exist
|
||||
if $node_type == 'server' and $facts['k8s_masters'] and $facts['k8s_masters'] > 2 {
|
||||
|
||||
# check if the repo already exists
|
||||
$helm_repos.each | String $repo, Stdlib::HTTPSUrl $url | {
|
||||
|
||||
@@ -12,13 +12,6 @@ class rke2 (
|
||||
Hash $helm_repos = $rke2::params::helm_repos,
|
||||
Array[String[1]] $extra_config_files = $rke2::params::extra_config_files,
|
||||
Stdlib::HTTPUrl $container_archive_source = $rke2::params::container_archive_source,
|
||||
Boolean $csi_ceph_enable = $rke2::params::csi_ceph_enable,
|
||||
Array[String] $csi_ceph_files = $rke2::params::csi_ceph_files,
|
||||
Array[String] $csi_ceph_templates = $rke2::params::csi_ceph_templates,
|
||||
Optional[String[1]] $csi_ceph_key = $rke2::params::csi_ceph_key,
|
||||
Optional[String[1] ] $csi_ceph_clusterid = $rke2::params::csi_ceph_clusterid,
|
||||
Optional[Array[String]] $csi_ceph_monitors = $rke2::params::csi_ceph_monitors,
|
||||
Optional[String[1]] $csi_ceph_poolname = $rke2::params::csi_ceph_poolname,
|
||||
) inherits rke2::params {
|
||||
|
||||
include rke2::install
|
||||
|
||||
@@ -12,11 +12,4 @@ class rke2::params (
|
||||
Hash $helm_repos = {},
|
||||
Array[String[1]] $extra_config_files = [],
|
||||
Stdlib::HTTPUrl $container_archive_source = 'https://github.com/rancher/rke2/releases/download',
|
||||
Boolean $csi_ceph_enable = false,
|
||||
Array[String] $csi_ceph_files = [],
|
||||
Array[String] $csi_ceph_templates = [],
|
||||
Optional[String[1]] $csi_ceph_key = undef,
|
||||
Optional[String[1] ] $csi_ceph_clusterid = undef,
|
||||
Optional[Array[String]] $csi_ceph_monitors = undef,
|
||||
Optional[String[1]] $csi_ceph_poolname = undef,
|
||||
) {}
|
||||
|
||||
Reference in New Issue
Block a user