Puppet Class: profile::rpkicounter

Defined in:
modules/profile/manifests/rpkicounter.pp

Overview

Class: profile::rpkicounter

This profile installs and configure rpkicounter

Actions:

* Calls the rpkicounter module
* Configure Kafkatee to pipe to rpkicounter
* Open ACLs for Prometheus

Parameters

prometheus_nodes

Prometheus nodes that should be allowed to query rpkicounter

proxy

“hostname:port” of proxy for https (optional)

Examples

include ::profile::kafkatee::webrequest::base (requirement)
include profile::rpkicounter

Parameters:

  • prometheus_nodes (Array[Stdlib::Fqdn]) (defaults to: hiera('prometheus_nodes'))
  • https_proxy (Optional[String]) (defaults to: hiera('http_proxy', undef))


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
52
53
# File 'modules/profile/manifests/rpkicounter.pp', line 22

class profile::rpkicounter(
  Array[Stdlib::Fqdn] $prometheus_nodes = hiera('prometheus_nodes'),
  Optional[String] $https_proxy = hiera('http_proxy', undef),
  ) {

  class { '::rpkicounter': }

  if $https_proxy {
      $proxy = "https_proxy=${https_proxy} "
  } else {
      $proxy = ''
  }

  include ::profile::kafkatee::webrequest::base

  kafkatee::output { 'rpkicounter':
      instance_name => 'webrequest',
      destination   => "${proxy}/usr/bin/python3 /usr/local/bin/rpkicounter.py",
      type          => 'pipe',
      sample        => 100,
  }


  $prometheus_nodes_ferm = join($prometheus_nodes, ' ')
  ferm::service { 'rpkicounter-prometheus-acl':
      desc   => 'rpkicounter prometheus port',
      proto  => 'tcp',
      port   => '9200',
      srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
  }

}