Puppet Class: profile::wmcs::kubeadm::core

Defined in:
modules/profile/manifests/wmcs/kubeadm/core.pp

Overview

SPDX-License-Identifier: Apache-2.0 Installs a container runtime and the core kubeadm tool

Parameters:

  • component (String) (defaults to: lookup('profile::wmcs::kubeadm::component', {default_value => 'thirdparty/kubeadm-k8s-1-21'}))
  • label_custom_domain (Optional[Stdlib::Fqdn]) (defaults to: lookup('profile::wmcs::kubeadm::label_custom_domain', {default_value => undef}))
  • mount_nfs (Boolean) (defaults to: lookup('mount_nfs', {default_value => false}))


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'modules/profile/manifests/wmcs/kubeadm/core.pp', line 3

class profile::wmcs::kubeadm::core (
    String $component = lookup('profile::wmcs::kubeadm::component', {default_value => 'thirdparty/kubeadm-k8s-1-21'}),
    Optional[Stdlib::Fqdn] $label_custom_domain = lookup('profile::wmcs::kubeadm::label_custom_domain', {default_value => undef}),
    Boolean $mount_nfs = lookup('mount_nfs', {default_value => false}),
) {
    class { '::kubeadm::repo':
        component => $component,
    }

    class { '::kubeadm::docker': }

    if $label_custom_domain {
        $label_base_domains = [
            $label_custom_domain,
            'kubernetes.wmcloud.org', # include this on all projects to make shared automation easier
        ]
    } else {
        $label_base_domains = ['kubernetes.wmcloud.org']
    }

    if $mount_nfs {
        $extra_labels = $label_base_domains.map |Stdlib::Fqdn $base_domain| {
            "${base_domain}/nfs-mounted=true"
        }
    } else {
        $extra_labels = []
    }

    class { '::kubeadm::core':
        extra_labels => $extra_labels,
    }

    class { '::kubeadm::calico_workaround': }
}