Puppet Class: loki

Defined in:
manifests/init.pp

Summary

A short summary of the purpose of this class

Overview

A description of what this class does

Examples:

Minimal example, creates a standalone loki instance (not desinged for production).

class{ 'loki':
  auth_enabled                => false,
  common_config_hash          => {'common' => {
                                    'path_prefix' => '/var/lib/loki',
                                 }},
  schema_config_hash          => {'schema_config' => {
                                    'configs' => [{
                                      'from'         => '2020-05-15',
                                      'store'        => 'boltdb',
                                      'object_store' => 'filesystem',
                                      'schema'       => 'v11',
                                      'index'        => {'prefix' => 'index_', 'period' => '168h'},
                                    }]
                                 }},
  storage_config_hash         => {'storage_config' => {
                                    'boltdb'     => { 'directory' => '/var/lib/loki/index'},
                                    'filesystem' => {'directory' => '/var/lib/loki/chunks'},
                                 }},
  server_config_hash          => {'server' => {
                                    'http_listen_port'    => 3100,
                                    'http_listen_address' => $facts['networking']['ip']},
                                 },
  ingester_client_config_hash => {'ingester' => {
                                    'lifecycler' => {
                                        'interface_names' => [$facts['networking']['primary']],
                                        'address'         => '127.0.0.1',
                                        'ring'            => {'kvstore' =>{'store' => 'inmemory'}, 'replication_factor' => 1},
                                    }
                                 }},
}

Parameters:

  • bin_dir (Stdlib::Absolutepath)

    path to install binary file.

  • config_dir (Stdlib::Absolutepath)

    path to install configuration file.

  • data_dir (Stdlib::Absolutepath)

    path where loki data will be stored.

  • group (String[1])

    Group that owns loki files.

  • install_method (Enum['archive','package'])

    How to install loki.

  • manage_service (Boolean)

    Manage the loki service.

  • package_name (String[1])

    Name of package to install.

  • package_version (String[1])

    Version of package to install.

  • schema_config_hash (Hash)

    Configures the chunk index schema

  • service_name (String[1])

    Name of service to manage.

  • service_provider (Enum['systemd'])

    Init system that is used.

  • service_ensure (Enum['running','stopped'])

    The state of the service.

  • storage_config_hash (Hash)

    The storage_config block configures one of many possible stores for both the index and chunks.

  • user (String[1])

    User that owns example files.

  • version (String[1])

    Version to install.

  • auth_enabled (Boolean) (defaults to: true)

    Enables authentication

  • chunk_store_config_hash (Optional[Hash]) (defaults to: undef)

    The chunk_store_config block configures how chunks will be cached

  • compactor_config_hash (Optional[Hash]) (defaults to: undef)

    Configures the compactor component which compacts index shards for performance.

  • distributor_config_hash (Optional[Hash]) (defaults to: undef)

    Configures the distributor.

  • frontend_worker_config_hash (Optional[Hash]) (defaults to: undef)

    The frontend_worker_config configures the worker

  • ingester_client_config_hash (Optional[Hash]) (defaults to: undef)

    Configures how the distributor will connect to ingesters.

  • ingester_config_hash (Optional[Hash]) (defaults to: undef)

    The ingester_client block configures how the distributor will connect to ingesters.

  • limits_config_hash (Optional[Hash]) (defaults to: undef)

    The limits_config block configures global and per-tenant limits in Loki.

  • manage_user (Boolean) (defaults to: $install_method ? { 'archive' => true, 'package' => false)

    Manage loki user and group.

  • manage_unit_file (Boolean) (defaults to: $install_method ? { 'archive' => true, 'package' => false)

    Manage unit file for service

  • querier_config_hash (Optional[Hash]) (defaults to: undef)

    Configures the querier.

  • query_scheduler_config_hash (Optional[Hash]) (defaults to: undef)

    The query_scheduler block configures the Loki query scheduler.

  • query_frontend_config_hash (Optional[Hash]) (defaults to: undef)

    The query_frontend block configures the Loki query address.

  • query_range_config_hash (Optional[Hash]) (defaults to: undef)

    The query_range block configures the query splitting and caching in the Loki query-frontend.

  • ruler_config_hash (Optional[Hash]) (defaults to: undef)

    The ruler block configures the Loki ruler.

  • runtime_config_hash (Optional[Hash]) (defaults to: undef)

    Configuration for ‘runtime config’ module, responsible for reloading runtime configuration file.

  • server_config_hash (Optional[Hash]) (defaults to: undef)

    Configures the server of the launched module(s).

  • table_manager_config_hash (Optional[Hash]) (defaults to: undef)

    The table_manager block configures the table manager for retention.

  • target (Optional[Loki::Target]) (defaults to: undef)

    A comma-separated list of components to run.

  • tracing_config_hash (Optional[Hash]) (defaults to: undef)

    Configuration for tracing.,

  • memberlist_config_hash (Optional[Hash]) (defaults to: undef)

    Configuration for memberlist client. Only applies if the selected kvstore is memberlist

  • common_config_hash (Optional[Hash]) (defaults to: undef)

    Common configuration to be shared between multiple modules.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'manifests/init.pp', line 74

class loki (
  Stdlib::Absolutepath $bin_dir,
  Stdlib::Absolutepath $config_dir,
  Stdlib::Absolutepath $data_dir,
  String[1] $group,
  Enum['archive','package'] $install_method,
  Boolean $manage_service,
  String[1] $package_name,
  String[1] $package_version,
  Hash $schema_config_hash,
  String[1] $service_name,
  Enum['systemd'] $service_provider,
  Enum['running','stopped'] $service_ensure,
  Hash $storage_config_hash,
  String[1] $user,
  String[1] $version,
  Boolean $auth_enabled = true,
  Optional[Hash] $chunk_store_config_hash = undef,
  Optional[Hash] $compactor_config_hash = undef,
  Optional[Hash] $distributor_config_hash = undef,
  Optional[Hash] $frontend_worker_config_hash = undef,
  Optional[Hash] $ingester_client_config_hash = undef,
  Optional[Hash] $ingester_config_hash = undef,
  Optional[Hash] $limits_config_hash = undef,
  Boolean $manage_user = $install_method ? { 'archive' => true, 'package' => false },
  Boolean $manage_unit_file = $install_method ? { 'archive' => true, 'package' => false },
  Optional[Hash] $querier_config_hash = undef,
  Optional[Hash] $query_scheduler_config_hash = undef,
  Optional[Hash] $query_frontend_config_hash = undef,
  Optional[Hash] $query_range_config_hash = undef,
  Optional[Hash] $ruler_config_hash = undef,
  Optional[Hash] $runtime_config_hash = undef,
  Optional[Hash] $server_config_hash = undef,
  Optional[Hash] $table_manager_config_hash = undef,
  Optional[Loki::Target] $target = undef,
  Optional[Hash] $tracing_config_hash = undef,
  Optional[Hash] $memberlist_config_hash = undef,
  Optional[Hash] $common_config_hash = undef,
) {
  if $loki::manage_service {
    $service_notify = [Service['loki']]
  } else {
    $service_notify = []
  }

  contain loki::install
  contain loki::config
  contain loki::service

  Class['loki::install']
  -> Class['loki::config']
  ~> Class['loki::service']
}