Defined Type: profile::thanos::sidecar

Defined in:
modules/profile/manifests/thanos/sidecar.pp

Overview

Parameters:

  • prometheus_port (Stdlib::Port::Unprivileged)
  • prometheus_instance (String)
  • enable_upload (Boolean) (defaults to: false)
  • min_time (Optional[String]) (defaults to: undef)


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
# File 'modules/profile/manifests/thanos/sidecar.pp', line 13

define profile::thanos::sidecar (
    Stdlib::Port::Unprivileged $prometheus_port,
    String $prometheus_instance,
    Boolean $enable_upload = false,
    Optional[String] $min_time = undef,
) {
    $http_port = $prometheus_port + 10000
    $grpc_port = $prometheus_port + 20000

    # XXX refactor to move the lookup() inside a class instead
    $objstore_account = lookup('profile::thanos::objstore_account') # lint:ignore:wmf_styleguide
    $objstore_password = lookup('profile::thanos::objstore_password') # lint:ignore:wmf_styleguide

    thanos::sidecar { $title :
        prometheus_port     => $prometheus_port,
        prometheus_instance => $prometheus_instance,
        http_port           => $http_port,
        grpc_port           => $grpc_port,
        min_time            => $min_time,
    }

    if $enable_upload {
        Thanos::Sidecar[$title] {
            objstore_account  => $objstore_account,
            objstore_password => $objstore_password,
        }
    }

    ferm::service { "thanos_sidecar_${title}":
        proto  => 'tcp',
        port   => "(${http_port} ${grpc_port})",
        srange => '$DOMAIN_NETWORKS', # XXX more restrictive
    }
}