Deploy cortex using ansible.
- Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)
All variables which can be overridden are stored in defaults/main.yml file as well as in table below.
Name | Default Value | Description |
---|---|---|
cortex_all_in_one |
true | Setup Cortex in all-in-one binary mode. |
cortex_services |
{} |
Cortex services configurations. |
cortex_web_listen_address |
"0.0.0.0:9009" | Address on which cortex will listen |
cortex_binary_local_dir |
"" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where cortex binaries are stored on host on which ansible is ran. This overrides cortex_version parameter |
cortex_interface |
"{{ ansible_default_ipv4.interface }}" | Network adapter that cortex will be using |
cortex_config_dir |
"/etc/cortex" | Default directory for the cortex config |
cortex_db_dir |
"/var/lib/cortex" | Path to the directory of the Cortex database |
cortex_limit_nofile |
10240 | Number of File Descriptors allowed for Cortex processes |
cortex_system_user |
"cortex" | Default Cortex user |
cortex_system_group |
"cortex" | Default Cortex group |
cortex_version |
1.7.0 | The cortex package version |
cortex_auth_enabled |
"false" | Enables of disables the Cortex authentication |
cortex_env_variables |
{} |
Configure Cortex environment variables. |
cortex_alertmanager |
{} |
Cortex alertmanager. Compatible with official configuration |
cortex_api |
{} |
Cortex api. Compatible with official configuration |
cortex_blocks_storage |
From block storage example | Cortex blocks storage. Compatible with official configuration |
cortex_chunck_store |
{} |
Cortex chunck store. Compatible with official configuration |
cortex_compactor |
From block storage example | Cortex compactor. Compatible with official configuration |
cortex_configs |
{} |
Cortex configs. Compatible with official configuration |
cortex_distributor |
From block storage example | Cortex distributor. Compatible with official configuration |
cortex_flusher |
{} |
Cortex flusher. Compatible with official configuration |
cortex_frontend_worker |
From block storage example | Cortex frontend worker. Compatible with official configuration |
cortex_frontend |
{} |
Cortex frontend. Compatible with official configuration |
cortex_ingester_client |
From block storage example | Cortex ingester client. Compatible with official configuration |
cortex_ingester |
From block storage example | Cortex ingester. Compatible with official configuration |
cortex_limits |
{} |
Cortex limits. Compatible with official configuration |
cortex_memberlist |
{} |
Cortex memberlist. Compatible with official configuration |
cortex_prealloc |
{} |
Cortex prealloc. Compatible with official configuration |
cortex_purger |
{} |
Cortex purger. Compatible with official configuration |
cortex_querier |
{} |
Cortex querier. Compatible with official configuration |
cortex_query_range |
{} |
Cortex query range. Compatible with official configuration |
cortex_ruler |
From block storage example | Cortex ruler. Compatible with official configuration |
cortex_runtime_config |
{} |
Cortex runtime config. Compatible with official configuration |
cortex_schema |
{} |
Cortex schema. Compatible with official configuration |
cortex_server |
From block storage example | Cortex server. Compatible with official configuration |
cortex_storage |
From block storage example | Cortex storage. Compatible with official configuration |
cortex_store_gateway |
{} |
Cortex store gateway. Compatible with official configuration |
cortex_table_manager |
{} |
Cortex table manager. Compatible with official configuration |
Use it in a playbook as follows:
- hosts: all
roles:
- cloudalchemy.cortex
You can run the different Cortex modules as separate services by setting
cortex_services
as a module:config map and cortex_all_in_one
to false
.
- hosts: all
roles:
- cloudalchemy.cortex
vars:
cortex_all_in_one: false
cortex_services:
ingester:
server:
http_listen_port: 9009
ingester:
lifecycler:
join_after: 0
min_ready_duration: 0s
final_sleep: 0s
num_tokens: 512
ring:
kvstore:
store: inmemory
replication_factor: 1
cortex_env_variables:
ingester:
JAEGER_AGENT_HOST: localhost
JAEGER_SAMPLER_PARAM: 0
JAEGER_SAMPLER_TYPE: const
The preferred way of locally testing the role is to use Docker and molecule (v3.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. Running your tests is as simple as executing molecule test
.
Combining molecule and circle CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which can take more time than local testing, so please be patient.
See troubleshooting.
This project is licensed under MIT License. See LICENSE for more details.