https://github.com/syberalexis/puppet-thanos
This module automates the install of Thanos and it's components into a service.
https://github.com/syberalexis/puppet-thanos
puppet puppet-forge thanos
Last synced: about 1 month ago
JSON representation
This module automates the install of Thanos and it's components into a service.
- Host: GitHub
- URL: https://github.com/syberalexis/puppet-thanos
- Owner: syberalexis
- License: apache-2.0
- Created: 2019-12-07T15:13:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T14:35:12.000Z (about 1 year ago)
- Last Synced: 2025-04-11T09:50:13.931Z (about 1 month ago)
- Topics: puppet, puppet-forge, thanos
- Language: Puppet
- Homepage: https://forge.puppet.com/maeq/thanos
- Size: 175 KB
- Stars: 4
- Watchers: 1
- Forks: 18
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# maeq-thanos
[](https://travis-ci.com/syberalexis/puppet-thanos)
[](https://ci.appveyor.com/project/syberalexis/puppet-thanos)
[](https://forge.puppetlabs.com/maeq/thanos)
[](https://forge.puppetlabs.com/maeq/thanos)
[](https://forge.puppetlabs.com/maeq/thanos)
[](https://forge.puppetlabs.com/maeq/thanos)
[](LICENSE)#### Table of Contents
- [Description](#description)
- [Usage](#usage)
- [Examples](#examples)
- [Limitations](#limitations)
- [Development](#development)## Description
This module automates the install of [Thanos](https://github.com/thanos-io/thanos) and it's components into a service.
Maximum tested version of Thanos : 0.26.0## Usage
For more information see [REFERENCE.md](REFERENCE.md).
### Install Thanos
#### Puppet
```puppet
class { 'thanos':
version => '0.26.0'
}
```#### Hiera Data
```puppet
include thanos
```
```yaml
thanos::version: '0.26.0'
```### Thanos Sidecar
```yaml
thanos::manage_sidecar: true
```### Thanos Query
```yaml
thanos::manage_query: true
thanos::query::endpoints:
- 'sidecar:10901'
- 'store:10901'
```### Thanos Query Frontend
```yaml
thanos::manage_query_frontend: true
```### Thanos Rule
```yaml
thanos::manage_rule: true
thanos::rule::queries:
- 'query:10901'
```### Thanos Store
```yaml
thanos::manage_store: true
```### Thanos Compact
```yaml
thanos::manage_compact: true
```### Thanos Receive
```yaml
thanos::manage_receive: true
```### Thanos Tools Bucket Web
```yaml
thanos::manage_tools_bucket_web: true
```### Manage Storage config
For more configuration information see [Thanos Storage configuration page](https://thanos.io/storage.md/#configuration).
#### Puppet
```puppet
thanos::storage { '/etc/thanos/storage.yaml':
ensure => 'present',
type => 'FILESYSTEM',
config => {
directory => '/data'
}
}
```### Yaml
```puppet
include thanos
```
```yaml
thanos::manage_storage_config: true
thanos::storage_config_file: '/etc/thanos/storage.yaml'
thanos::storage_config:
ensure: 'present'
type: 'FILESYSTEM'
config:
directory: '/data'
```### Manage Tracing config
For more configuration information see [Thanos Tracing configuration page](https://thanos.io/tracing.md/#configuration).
#### Puppet
```puppet
thanos::tracing { '/etc/thanos/tracing.yaml':
ensure => 'present',
type => 'JAEGER',
config => {
service_name => '',
disabled => false,
rpc_metrics => false,
tags => '',
sampler_type => '',
sampler_param => 0,
sampler_manager_host_port => '',
sampler_max_operations => 0,
sampler_refresh_interval => '0s',
reporter_max_queue_size => 0,
reporter_flush_interval => '0s',
reporter_log_spans => false,
endpoint => '',
user => '',
password => '',
agent_host => '',
agent_port => 0,
}
}
```### Yaml
```puppet
include thanos
```
```yaml
thanos::manage_tracing_config: true
thanos::tracing_config_file: '/etc/thanos/tracing.yaml'
thanos::tracing_config:
ensure: 'present'
type: 'JAEGER'
config:
service_name: ''
disabled: false
rpc_metrics: false
tags: ''
sampler_type: ''
sampler_param: 0
sampler_manager_host_port: ''
sampler_max_operations: 0
sampler_refresh_interval: '0s'
reporter_max_queue_size: 0
reporter_flush_interval: '0s'
reporter_log_spans: false
endpoint: ''
user: ''
password: ''
agent_host: ''
agent_port: 0
```## Examples
### Install from other source
```yaml
thanos::base_url: 'http://my_private_dropbox/thanos'
```
Or
```yaml
thanos::download_url: 'http://my_private_dropbox/thanos/thanos-0.10.1.tar.gz'
```### Install all in one
It's not a very good idea to deploy like this in Production. But it's possible to test it on the same machine.
```yaml
thanos::manage_sidecar: true
thanos::manage_query: true
thanos::manage_rule: true
thanos::manage_store: true
thanos::manage_compact: truethanos::sidecar::http_address: '0.0.0.0:10902'
thanos::sidecar::grpc_address: '0.0.0.0:10901'
thanos::sidecar::objstore_config_file: '/etc/thanos/storage.yaml'
thanos::query::http_address: '0.0.0.0:10904'
thanos::query::grpc_address: '0.0.0.0:10903'
thanos::query::endpoints:
- 'localhost:10901'
- 'localhost:10907'
thanos::rule::http_address: '0.0.0.0:10906'
thanos::rule::grpc_address: '0.0.0.0:10905'
thanos::rule::queries:
- 'localhost:10903'
thanos::store::http_address: '0.0.0.0:10908'
thanos::store::grpc_address: '0.0.0.0:10907'
thanos::compact::http_address: '0.0.0.0:10910'
thanos::compact::grpc_address: '0.0.0.0:10909'thanos::manage_storage_config: true
thanos::storage_config_file: '/etc/thanos/storage.yaml'
thanos::storage_config:
ensure: 'present'
type: 'FILESYSTEM'
config:
directory: '/data'
```### Sidecar with Prometheus
I recommend to use the module [puppet-prometheus](https://forge.puppet.com/puppet/prometheus), it is very easy to use.
```puppet
include prometheus
include thanos
```
```yaml
prometheus::manage_prometheus_server: true
prometheus::config_dir: '/etc/prometheus'
prometheus::configname: 'prometheus.yaml'
prometheus::localstorage: '/data/prometheus'
prometheus::extra_options: '--web.enable-lifecycle --storage.tsdb.min-block-duration=2h --storage.tsdb.max-block-duration=2h'thanos::manage_sidecar: true
thanos::tsdb_path: '/data/prometheus'
thanos::reloader_config_file: '/etc/prometheus/prometheus.yaml'
```## Limitations
Only support, Thanos supported OS. See [Thanos releases page](https://github.com/thanos-io/thanos/releases)
## Development
See [Contributing](CONTRIBUTING.md).
This project contains tests for [rspec-puppet](http://rspec-puppet.com/).
Quickstart to run all linter and unit tests:
```bash
bundle install
bundle exec rake validate
```
Or
```bash
pdk validate
pdk test unit
```