Puppet Class: profile::thanos::store

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

Overview

Parameters:

  • prometheus_nodes (Array) (defaults to: lookup('prometheus_nodes'))
  • objstore_account (Hash[String, String]) (defaults to: lookup('profile::thanos::objstore_account'))
  • objstore_password (String) (defaults to: lookup('profile::thanos::objstore_password'))
  • query_hosts (Array) (defaults to: lookup('profile::thanos::frontends'))
  • max_time (Optional[String]) (defaults to: lookup('profile::thanos::store::max_time', { 'default_value' => undef }))
  • min_time (Optional[String]) (defaults to: lookup('profile::thanos::store::min_time', { 'default_value' => undef }))


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

class profile::thanos::store (
    Array $prometheus_nodes = lookup('prometheus_nodes'),
    Hash[String, String] $objstore_account = lookup('profile::thanos::objstore_account'),
    String $objstore_password = lookup('profile::thanos::objstore_password'),
    Array $query_hosts = lookup('profile::thanos::frontends'),
    Optional[String] $max_time = lookup('profile::thanos::store::max_time', { 'default_value' => undef }),
    Optional[String] $min_time = lookup('profile::thanos::store::min_time', { 'default_value' => undef }),
) {
    $http_port = 11902
    $grpc_port = 11901

    class { 'thanos::store':
        objstore_account  => $objstore_account,
        objstore_password => $objstore_password,
        http_port         => $http_port,
        grpc_port         => $grpc_port,
        max_time          => $max_time,
        min_time          => $min_time,
        consistency_delay => '30m',
    }

    # Allow access from query hosts
    $query_hosts_ferm = join($query_hosts, ' ')
    ferm::service { 'thanos_store_query':
        proto  => 'tcp',
        port   => $grpc_port,
        srange => "(@resolve((${query_hosts_ferm})) @resolve((${query_hosts_ferm}), AAAA))",
    }

    # Allow access only to store to scrape metrics
    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')
    ferm::service { 'thanos_store_prometheus':
        proto  => 'tcp',
        port   => $http_port,
        srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
    }
}