Puppet Class: thanos::store

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

Overview

TODO(filippo) evaluate using memcache (shared with swift) for caching

Parameters:

  • objstore_account (Hash[String, String])
  • objstore_password (String)
  • http_port (Stdlib::Port::Unprivileged) (defaults to: 11902)
  • grpc_port (Stdlib::Port::Unprivileged) (defaults to: 11901)
  • min_time (Optional[String]) (defaults to: undef)
  • max_time (Optional[String]) (defaults to: undef)
  • consistency_delay (Optional[String]) (defaults to: undef)


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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'modules/thanos/manifests/store.pp', line 21

class thanos::store (
    Hash[String, String] $objstore_account,
    String $objstore_password,
    Stdlib::Port::Unprivileged $http_port = 11902,
    Stdlib::Port::Unprivileged $grpc_port = 11901,
    Optional[String] $min_time = undef,
    Optional[String] $max_time = undef,
    Optional[String] $consistency_delay = undef,
) {
    ensure_packages(['thanos'])

    $http_address = "0.0.0.0:${http_port}"
    $grpc_address = "0.0.0.0:${grpc_port}"
    $service_name = 'thanos-store'
    $data_dir = '/srv/thanos-store'
    $cache_config_file = '/etc/thanos-store/cache.yaml'
    $objstore_config_file = '/etc/thanos-store/objstore.yaml'

    file { $data_dir:
        ensure => directory,
        mode   => '0750',
        owner  => 'thanos',
        group  => 'thanos',
    }

    file { '/etc/thanos-store':
        ensure => directory,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
    }

    file { $cache_config_file:
        ensure  => present,
        mode    => '0444',
        owner   => 'root',
        group   => 'root',
        content => template('thanos/store_cache.yaml.erb'),
    }

    file { $objstore_config_file:
        ensure    => present,
        mode      => '0440',
        owner     => 'thanos',
        group     => 'root',
        show_diff => false,
        content   => template('thanos/objstore.yaml.erb'),
    }

    systemd::service { $service_name:
        ensure         => present,
        restart        => true,
        override       => true,
        content        => systemd_template('thanos-store'),
        service_params => {
            enable     => true,
            hasrestart => true,
        },
    }
}