feat: moderate the k8s install
- only install a base config - wait for 3 masters before deploying helm charts - remove nginx and rancher-ingres configurations
This commit is contained in:
@@ -24,9 +24,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 +73,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'] {
|
||||
@@ -89,17 +87,17 @@ class rke2::config (
|
||||
}
|
||||
}
|
||||
|
||||
# wait for rancher helm to setup namespace
|
||||
if 'cattle-system' in $facts['k8s_namespaces'] {
|
||||
file {'/var/lib/rancher/rke2/server/manifests/ingress-route-rancher.yaml':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/rke2/ingress-route-rancher.yaml',
|
||||
require => Service['rke2-server'],
|
||||
}
|
||||
}
|
||||
## wait for rancher helm to setup namespace
|
||||
#if 'cattle-system' in $facts['k8s_namespaces'] {
|
||||
# file {'/var/lib/rancher/rke2/server/manifests/ingress-route-rancher.yaml':
|
||||
# ensure => file,
|
||||
# owner => 'root',
|
||||
# group => 'root',
|
||||
# mode => '0644',
|
||||
# source => 'puppet:///modules/rke2/ingress-route-rancher.yaml',
|
||||
# require => Service['rke2-server'],
|
||||
# }
|
||||
#}
|
||||
|
||||
# manage extra config config (these are not dependent on helm)
|
||||
$extra_config_files.each |$file| {
|
||||
|
||||
@@ -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 | {
|
||||
|
||||
Reference in New Issue
Block a user