Puppet Class: k8s::kubelet

Defined in:
modules/k8s/manifests/kubelet.pp

Overview

Parameters:

  • listen_address (Any) (defaults to: '0.0.0.0')
  • listen_port (Any) (defaults to: undef)
  • pod_infra_container_image (Any) (defaults to: 'gcr.io/google_containers/pause:2.0')
  • cluster_domain (Any) (defaults to: 'kube')
  • tls_cert (Any) (defaults to: '/var/lib/kubernetes/ssl/certs/cert.pem')
  • tls_key (Any) (defaults to: '/var/lib/kubernetes/ssl/private_keys/server.key')
  • cni (Any) (defaults to: false)
  • cni_bin_dir (Any) (defaults to: '/opt/cni/bin')
  • cni_conf_dir (Any) (defaults to: '/etc/cni/net.d')
  • kubeconfig (Any) (defaults to: '/etc/kubernetes/kubeconfig')
  • node_labels (Any) (defaults to: [])
  • node_taints (Any) (defaults to: [])
  • extra_params (Any) (defaults to: undef)


1
2
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'modules/k8s/manifests/kubelet.pp', line 1

class k8s::kubelet(
    $listen_address = '0.0.0.0',
    $listen_port = undef,
    $pod_infra_container_image = 'gcr.io/google_containers/pause:2.0',
    $cluster_domain = 'kube',
    $tls_cert = '/var/lib/kubernetes/ssl/certs/cert.pem',
    $tls_key = '/var/lib/kubernetes/ssl/private_keys/server.key',
    $cni = false,
    $cni_bin_dir = '/opt/cni/bin',
    $cni_conf_dir = '/etc/cni/net.d',
    $kubeconfig = '/etc/kubernetes/kubeconfig',
    $node_labels = [],
    $node_taints = [],
    $extra_params = undef,
) {
    require ::k8s::infrastructure_config

    require_package('kubernetes-node')

    # Needed on k8s nodes for kubectl proxying to work
    ensure_packages(['socat'])

    file { '/etc/default/kubelet':
        ensure  => file,
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        content => template('k8s/kubelet.default.erb'),
        notify  => Service['kubelet'],
    }

    file { [
        '/var/run/kubernetes',
        '/var/lib/kubelet',
    ] :
        ensure => directory,
        owner  => 'root',
        group  => 'root',
        mode   => '0700',
    }

    service { 'kubelet':
        ensure    => running,
        enable    => true,
        subscribe => [
            File[$kubeconfig],
            File['/etc/default/kubelet'],
        ],
    }

}