Puppet Class: profile::calico::kubernetes

Defined in:
modules/profile/manifests/calico/kubernetes.pp

Overview

Parameters:

  • etcd_endpoints (Any) (defaults to: hiera('profile::calico::kubernetes::etcd_endpoints'))
  • bgp_peers (Any) (defaults to: hiera('profile::calico::kubernetes::bgp_peers'))
  • calico_version (Any) (defaults to: hiera('profile::calico::kubernetes::calico_version'))
  • registry (Any) (defaults to: hiera('profile::calico::kubernetes::docker::registry'))
  • kubeconfig (Any) (defaults to: hiera('profile::kubernetes::node::kubelet_config'))
  • datastore_type (Any) (defaults to: hiera('profile::calico::kubernetes::calico_datastore_type', 'etcdv2'))
  • prometheus_nodes (Any) (defaults to: hiera('prometheus_nodes', []))


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
# File 'modules/profile/manifests/calico/kubernetes.pp', line 6

class profile::calico::kubernetes(
    $etcd_endpoints = hiera('profile::calico::kubernetes::etcd_endpoints'),
    $bgp_peers = hiera('profile::calico::kubernetes::bgp_peers'),
    $calico_version = hiera('profile::calico::kubernetes::calico_version'),
    $registry = hiera('profile::calico::kubernetes::docker::registry'),
    $kubeconfig = hiera('profile::kubernetes::node::kubelet_config'),
    $datastore_type = hiera('profile::calico::kubernetes::calico_datastore_type', 'etcdv2'),
    $prometheus_nodes = hiera('prometheus_nodes', []),
) {

    class { '::calico':
        etcd_endpoints => $etcd_endpoints,
        calico_version => $calico_version,
        datastore_type => $datastore_type,
        registry       => $registry,
    }

    class { '::calico::cni':
        kubeconfig     => $kubeconfig,
        datastore_type => $datastore_type,
    }

    $bgp_peers_ferm = join($bgp_peers, ' ')
    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')

    ferm::service { 'calico-bird':
        proto  => 'tcp',
        port   => '179', # BGP
        srange => "(@resolve((${bgp_peers_ferm})) @resolve((${bgp_peers_ferm}), AAAA))",
    }
    ferm::service { 'calico-felix-prometheus':
        proto  => 'tcp',
        port   => '9091', # prometheus
        srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
    }
}