Puppet Class: k8s::proxy

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

Overview

Parameters:

  • master_host (Any)
  • proxy_mode (Any) (defaults to: 'iptables')
  • masquerade_all (Any) (defaults to: true)
  • kubeconfig (Any) (defaults to: '/etc/kubernetes/kubeconfig')


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
# File 'modules/k8s/manifests/proxy.pp', line 1

class k8s::proxy(
    $master_host,
    $proxy_mode = 'iptables',
    $masquerade_all = true,
    $kubeconfig = '/etc/kubernetes/kubeconfig',
) {
    require ::k8s::infrastructure_config

    require_package('kubernetes-node')

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


    if os_version('ubuntu <= trusty') {
      # Split this out into two, since we want to use the systemd unit
      # file from the deb but from puppet on upstart
      base::service_unit { 'kube-proxy':
          upstart         => upstart_template('kube-proxy'),
          declare_service => false,
      }
    }

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

    }
}