Puppet Class: thanos::tools::bucket_web

Defined in:
manifests/tools/bucket_web.pp

Summary

This class manages bucket web interface service

Overview

This class install Web interface for remote storage bucket.

Examples:

include thanos::bucket_web

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    State ensured from compact service.

  • user (String) (defaults to: $thanos::user)

    User running thanos.

  • group (String) (defaults to: $thanos::group)

    Group under which thanos is running.

  • bin_path (Stdlib::Absolutepath) (defaults to: $thanos::bin_path)

    Path where binary is located.

  • log_level (Thanos::Log_level) (defaults to: 'info')

    Only log messages with the given severity or above. One of: [debug, info, warn, error, fatal]

  • log_format (Enum['logfmt', 'json']) (defaults to: 'logfmt')

    Output format of log messages. One of: [logfmt, json]

  • tracing_config_file (Optional[Stdlib::Absolutepath]) (defaults to: $thanos::tracing_config_file)

    Path to YAML file with tracing configuration. See format details: thanos.io/tracing.md/#configuration

  • objstore_config_file (Optional[Stdlib::Absolutepath]) (defaults to: $thanos::storage_config_file)

    Path to YAML file that contains object store configuration. See format details: thanos.io/storage.md/#configuration

  • http_address (String) (defaults to: '0.0.0.0:10902')

    Listen host:port for HTTP endpoints.

  • http_grace_period (String) (defaults to: '2m')

    Time to wait after an interrupt received for HTTP Server.

  • web_external_prefix (Optional[String]) (defaults to: undef)

    Static prefix for all HTML links and redirect URLs in the bucket web UI interface. Actual endpoints are still served on / or the web.route-prefix. This allows thanos bucket web UI to be served behind a reverse proxy that strips a URL sub-path.

  • web_prefix_header (Optional[String]) (defaults to: undef)

    Name of HTTP request header used for dynamic prefixing of UI links and redirects. This option is ignored if web.external-prefix argument is set. Security risk: enable this option only if a reverse proxy in front of thanos is resetting the header. The –web.prefix-header=X-Forwarded-Prefix option can be useful, for example, if Thanos UI is served via Traefik

    reverse proxy with PathPrefixStrip option enabled, which sends the stripped prefix value in X-Forwarded-Prefix header.
    

    This allows thanos UI to be served on a sub-path.

  • refresh (String) (defaults to: '30m')

    Refresh interval to download metadata from remote storage

  • timeout (String) (defaults to: '5m')

    Timeout to download metadata from remote storage

  • label (Optional[String]) (defaults to: undef)

    Prometheus label to use as timeline title

  • max_open_files (Optional[Integer]) (defaults to: undef)

    Define how many open files the service is able to use In some cases, the default value (1024) needs to be increased

  • extra_params (Hash) (defaults to: {})

    Parameters passed to the binary, ressently released in latest version of Thanos.



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'manifests/tools/bucket_web.pp', line 49

class thanos::tools::bucket_web (
  Enum['present', 'absent']      $ensure               = 'present',
  String                         $user                 = $thanos::user,
  String                         $group                = $thanos::group,
  Stdlib::Absolutepath           $bin_path             = $thanos::bin_path,
  # Binary Parameters
  Thanos::Log_level              $log_level            = 'info',
  Enum['logfmt', 'json']         $log_format           = 'logfmt',
  Optional[Stdlib::Absolutepath] $tracing_config_file  = $thanos::tracing_config_file,
  Optional[Stdlib::Absolutepath] $objstore_config_file = $thanos::storage_config_file,
  String                         $http_address         = '0.0.0.0:10902',
  String                         $http_grace_period    = '2m',
  Optional[String]               $web_external_prefix  = undef,
  Optional[String]               $web_prefix_header    = undef,
  String                         $refresh              = '30m',
  String                         $timeout              = '5m',
  Optional[String]               $label                = undef,
  Optional[Integer]              $max_open_files       = undef,
  # Extra parametes
  Hash                           $extra_params         = {},
) {
  $_service_ensure = $ensure ? {
    'present' => 'running',
    default   => 'stopped'
  }

  thanos::resources::service { 'bucket-web':
    ensure         => $_service_ensure,
    name           => 'tools bucket web',
    bin_path       => $bin_path,
    user           => $user,
    group          => $group,
    max_open_files => $max_open_files,
    params         => {
      'log.level'            => $log_level,
      'log.format'           => $log_format,
      'tracing.config-file'  => $tracing_config_file,
      'objstore.config-file' => $objstore_config_file,
      'http-address'         => $http_address,
      'http-grace-period'    => $http_grace_period,
      'web.external-prefix'  => $web_external_prefix,
      'web.prefix-header'    => $web_prefix_header,
      'refresh'              => $refresh,
      'timeout'              => $timeout,
      'label'                => $label,
    },
    extra_params   => $extra_params,
  }
}