Puppet Class: kubernetes

Defined in:
manifests/init.pp

Overview

Class: kubernetes

mjs-Kubernetes enables the provisioning of Kubernetes clients and masters. Note that this has been tested on CentOS 7 which incidently has all the packages you need from epel

Parameters


Document parameters here.

  • ‘sample parameter`

Explanation of what this parameter affects and what it defaults to. e.g. “Specify one or more upstream ntp servers as an array.”

Variables


Here you should define a list of variables that this module would require.

  • ‘sample variable`

Explanation of how this variable affects the function of this class and if
it has a default. e.g. "The parameter enc_ntp_servers must be set by the
External Node Classifier as a comma separated list of hostnames." (Note,
global variables should be avoided in favor of class parameters as
of Puppet 2.6.)

Examples


Authors


Michael Stein <msuddd@gmail.com>

Copyright


Copyright 2015 Michael Stein

Examples:

for master


class { 'kubernetes::master':
  minion_name => [minion1.example.com,minion2.example.com],
  master_name => master.example.com,
}

for minion

class { 'kubernetes::minion':
  minion_name => minion1.example.com,
  master_name => master.example.com,
}

Parameters:

  • master_name (Any)
  • minion_name (Any)
  • populate_hosts (Any) (defaults to: false)


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'manifests/init.pp', line 53

class kubernetes($master_name, $minion_name, $populate_hosts = false) {
  class{'kubernetes::hosts':
    populate_hosts => $populate_hosts,
  }
  contain 'kubernetes::hosts'

  package {['docker', 'docker-logrotate', 'kubernetes', 'etcd', 'flannel']:
    ensure => present,
  }->

  file{'/etc/kubernetes/config':
    content => template('kubernetes/kub_config.erb')
  }->
  file{'/etc/sysconfig/flanneld':
    content => template('kubernetes/flanneld.erb'),
  }

}