Puppet Class: profile::thanos::swift::backend

Defined in:
modules/profile/manifests/thanos/swift/backend.pp

Overview

Parameters:

  • thanos_backends (Array) (defaults to: lookup('profile::thanos::backends'))
  • thanos_frontends (Array) (defaults to: lookup('profile::thanos::frontends'))
  • swift_cluster (String) (defaults to: lookup('profile::thanos::swift::cluster'))
  • memcached_servers (Array) (defaults to: lookup('profile::thanos::swift::memcached_servers'))
  • hash_path_suffix (String) (defaults to: lookup('profile::thanos::swift::hash_path_suffix'))
  • drives (Array) (defaults to: lookup('swift_storage_drives'))
  • aux_partitions (Array) (defaults to: lookup('swift_aux_partitions'))


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

class profile::thanos::swift::backend (
    Array $thanos_backends = lookup('profile::thanos::backends'),
    Array $thanos_frontends = lookup('profile::thanos::frontends'),
    String $swift_cluster = lookup('profile::thanos::swift::cluster'),
    Array $memcached_servers = lookup('profile::thanos::swift::memcached_servers'),
    String $hash_path_suffix = lookup('profile::thanos::swift::hash_path_suffix'),
    Array $drives = lookup('swift_storage_drives'),
    Array $aux_partitions = lookup('swift_aux_partitions'),
) {
    class { '::swift':
        hash_path_suffix => $hash_path_suffix,
    }

    class { '::swift::ring':
        swift_cluster => $swift_cluster,
    }

    class { '::swift::storage':
        statsd_metric_prefix => "swift.${swift_cluster}.${::hostname}",
        memcached_servers    => $memcached_servers,
    }

    class { '::toil::systemd_scope_cleanup': }

    include ::profile::statsite
    class { '::profile::prometheus::statsd_exporter':
        relay_address => '',
    }

    nrpe::monitor_service { 'load_average':
        description  => 'very high load average likely xfs',
        nrpe_command => '/usr/lib/nagios/plugins/check_load -w 80,80,80 -c 200,100,100',
        notes_url    => 'https://wikitech.wikimedia.org/wiki/Swift',
    }

    swift::init_device { $drives:
        partition_nr => '1',
    }

    # these are already partitioned and xfs formatted by the installer
    swift::label_filesystem { $aux_partitions: }
    swift::mount_filesystem { $aux_partitions: }

    $swift_access = concat($thanos_backends, $thanos_frontends)
    $swift_access_ferm = join($swift_access, ' ')
    $swift_rsync_access_ferm = join($thanos_backends, ' ')

    # Optimize ferm rule aggregating all ports, it includes:
    # - base object server (6000)
    # - container server (6001)
    # - account server (6002)
    # - per-disk object-server ports T222366 (6010:6030)
    ferm::service { 'swift-object-server':
        proto   => 'tcp',
        port    => '(6000:6002 6010:6030)',
        notrack => true,
        srange  => "@resolve((${swift_access_ferm}))",
    }

    ferm::service { 'swift-rsync':
        proto   => 'tcp',
        port    => '873',
        notrack => true,
        srange  => "@resolve((${swift_rsync_access_ferm}))",
    }
}