|
5 | 5 | replication_factor: 3, |
6 | 6 | external_url: error 'must define external url for cluster', |
7 | 7 |
|
8 | | - storage_backend: error 'must specify storage backend (cassandra, gcp)', |
| 8 | + storage_backend: error 'must specify storage backend (cassandra, gcp, aws)', |
9 | 9 | table_prefix: $._config.namespace, |
10 | 10 | cassandra_addresses: error 'must specify cassandra addresses', |
11 | 11 | bigtable_instance: error 'must specify bigtable instance', |
|
56 | 56 |
|
57 | 57 | // Use the Cortex chunks storage engine by default, while giving the ability |
58 | 58 | // to switch to blocks storage. |
59 | | - storage_engine: 'chunks', |
| 59 | + storage_engine: 'chunks', // Available options are 'chunks' or 'blocks' |
| 60 | + blocks_storage_backend: 'gcs', |
| 61 | + blocks_storage_bucket_name: error 'must specify blocks storage bucket name', |
| 62 | + blocks_storage_s3_endpoint: 's3.dualstack.us-east-1.amazonaws.com', |
| 63 | + |
60 | 64 | // Secondary storage engine is only used for querying. |
61 | 65 | querier_second_storage_engine: null, |
62 | | - blocks_storage_bucket_name: error 'must specify GCS bucket name to store TSDB blocks', |
63 | 66 |
|
64 | 67 | store_gateway_replication_factor: 3, |
65 | 68 |
|
|
141 | 144 | $._config.client_configs.gcp + |
142 | 145 | { 'schema-config-file': '/etc/cortex/schema/config.yaml' }, |
143 | 146 |
|
| 147 | + genericBlocksStorageConfig:: { |
| 148 | + 'store.engine': $._config.storage_engine, // May still be chunks |
| 149 | + 'experimental.blocks-storage.tsdb.dir': '/data/tsdb', |
| 150 | + 'experimental.blocks-storage.bucket-store.sync-dir': '/data/tsdb', |
| 151 | + 'experimental.blocks-storage.bucket-store.ignore-deletion-marks-delay': '1h', |
| 152 | + 'experimental.blocks-storage.tsdb.block-ranges-period': '2h', |
| 153 | + 'experimental.blocks-storage.tsdb.retention-period': '96h', // 4 days protection against blocks not being uploaded from ingesters. |
| 154 | + 'experimental.blocks-storage.tsdb.ship-interval': '1m', |
| 155 | + |
| 156 | + 'experimental.store-gateway.sharding-enabled': true, |
| 157 | + 'experimental.store-gateway.sharding-ring.store': 'consul', |
| 158 | + 'experimental.store-gateway.sharding-ring.consul.hostname': 'consul.%s.svc.cluster.local:8500' % $._config.namespace, |
| 159 | + 'experimental.store-gateway.sharding-ring.prefix': '', |
| 160 | + 'experimental.store-gateway.replication-factor': $._config.store_gateway_replication_factor, |
| 161 | + |
| 162 | + }, |
| 163 | + gcsBlocksStorageConfig:: $._config.genericBlocksStorageConfig { |
| 164 | + 'experimental.blocks-storage.backend': 'gcs', |
| 165 | + 'experimental.blocks-storage.gcs.bucket-name': $._config.blocks_storage_bucket_name, |
| 166 | + }, |
| 167 | + s3BlocksStorageConfig:: $._config.genericBlocksStorageConfig { |
| 168 | + 'experimental.blocks-storage.backend': 's3', |
| 169 | + 'experimental.blocks-storage.s3.bucket-name': $._config.blocks_storage_bucket_name, |
| 170 | + 'experimental.blocks-storage.s3.endpoint': $._config.blocks_storage_s3_endpoint, |
| 171 | + }, |
144 | 172 | // Blocks storage configuration, used only when 'blocks' storage |
145 | 173 | // engine is explicitly enabled. |
146 | 174 | blocksStorageConfig: ( |
147 | | - if $._config.storage_engine == 'blocks' || $._config.querier_second_storage_engine == 'blocks' then { |
148 | | - 'store.engine': $._config.storage_engine, // May still be chunks |
149 | | - 'experimental.blocks-storage.tsdb.dir': '/data/tsdb', |
150 | | - 'experimental.blocks-storage.bucket-store.sync-dir': '/data/tsdb', |
151 | | - 'experimental.blocks-storage.bucket-store.ignore-deletion-marks-delay': '1h', |
152 | | - 'experimental.blocks-storage.tsdb.block-ranges-period': '2h', |
153 | | - 'experimental.blocks-storage.tsdb.retention-period': '96h', // 4 days protection against blocks not being uploaded from ingesters. |
154 | | - 'experimental.blocks-storage.tsdb.ship-interval': '1m', |
155 | | - 'experimental.blocks-storage.backend': 'gcs', |
156 | | - 'experimental.blocks-storage.gcs.bucket-name': $._config.blocks_storage_bucket_name, |
157 | | - 'experimental.store-gateway.sharding-enabled': true, |
158 | | - 'experimental.store-gateway.sharding-ring.store': 'consul', |
159 | | - 'experimental.store-gateway.sharding-ring.consul.hostname': 'consul.%s.svc.cluster.local:8500' % $._config.namespace, |
160 | | - 'experimental.store-gateway.sharding-ring.prefix': '', |
161 | | - 'experimental.store-gateway.replication-factor': $._config.store_gateway_replication_factor, |
162 | | - } else {} |
| 175 | + if $._config.storage_engine == 'blocks' || $._config.querier_second_storage_engine == 'blocks' then ( |
| 176 | + if $._config.blocks_storage_backend == 'gcs' then $._config.gcsBlocksStorageConfig |
| 177 | + else if $._config.blocks_storage_backend == 's3' then $._config.s3BlocksStorageConfig |
| 178 | + else $._config.genericBlocksStorageConfig |
| 179 | + ) else {} |
163 | 180 | ), |
164 | 181 |
|
165 | 182 | // Shared between the Ruler and Querier |
|
0 commit comments