Skip to content

Commit 35c2b8e

Browse files
authored
Populate config.querier.store_gateway_addresses automatically (grafana#201)
Signed-off-by: Tom Hayward <[email protected]>
1 parent f6454e5 commit 35c2b8e

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [FEATURE] Add autoscaler for queriers #190
66
* [FEATURE] Add autoscaler for distributors #189
77
* [FEATURE] Add autoscaler for ingesters #182
8+
* [ENHANCEMENT] Populate config.querier.store_gateway_addresses automatically based on other config #201
89
* [ENHANCEMENT] Graceful shutdown of ingesters #195
910
* [ENHANCEMENT] Define namespace in templates #184
1011
* [ENHANCEMENT] Use FQDN for memcached addresses #175

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ Kubernetes: `^1.19.0-0`
329329
| config.&ZeroWidthSpace;memberlist.&ZeroWidthSpace;join_members | list | `[]` | the service name of the memberlist if using memberlist discovery |
330330
| config.&ZeroWidthSpace;querier.&ZeroWidthSpace;active_query_tracker_dir | string | `"/data/cortex/querier"` | |
331331
| config.&ZeroWidthSpace;querier.&ZeroWidthSpace;query_ingesters_within | string | `"12h"` | |
332+
| config.&ZeroWidthSpace;querier.&ZeroWidthSpace;store_gateway_addresses | string | automatic | Comma separated list of store-gateway addresses in DNS Service Discovery format. This option should is set automatically when using the blocks storage and the store-gateway sharding is disabled (when enabled, the store-gateway instances form a ring and addresses are picked from the ring). |
332333
| config.&ZeroWidthSpace;query_range.&ZeroWidthSpace;align_queries_with_step | bool | `true` | |
333334
| config.&ZeroWidthSpace;query_range.&ZeroWidthSpace;cache_results | bool | `true` | |
334335
| config.&ZeroWidthSpace;query_range.&ZeroWidthSpace;results_cache.&ZeroWidthSpace;cache.&ZeroWidthSpace;memcached.&ZeroWidthSpace;expiration | string | `"1h"` | |
@@ -361,6 +362,7 @@ Kubernetes: `^1.19.0-0`
361362
| config.&ZeroWidthSpace;storage.&ZeroWidthSpace;engine | string | `"chunks"` | |
362363
| config.&ZeroWidthSpace;storage.&ZeroWidthSpace;index_queries_cache_config.&ZeroWidthSpace;memcached.&ZeroWidthSpace;expiration | string | `"1h"` | |
363364
| config.&ZeroWidthSpace;storage.&ZeroWidthSpace;index_queries_cache_config.&ZeroWidthSpace;memcached_client.&ZeroWidthSpace;timeout | string | `"1s"` | |
365+
| config.&ZeroWidthSpace;store_gateway | object | `{}` | https://cortexmetrics.io/docs/configuration/configuration-file/#store_gateway_config |
364366
| config.&ZeroWidthSpace;table_manager.&ZeroWidthSpace;retention_deletes_enabled | bool | `false` | |
365367
| config.&ZeroWidthSpace;table_manager.&ZeroWidthSpace;retention_period | string | `"0s"` | |
366368
| configs.&ZeroWidthSpace;affinity | object | `{}` | |

ci/test-values.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ config:
4848
filesystem:
4949
dir: "/data/store"
5050

51-
querier:
52-
store_gateway_addresses: 'dns+{{ include "cortex.storeGatewayFullname" $ }}-headless:9095'
53-
5451
memberlist:
5552
join_members:
5653
- '{{ include "cortex.fullname" $ }}-memberlist'

values.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ config:
134134
expiration: 1h
135135
memcached_client:
136136
timeout: 1s
137+
# -- https://cortexmetrics.io/docs/configuration/configuration-file/#store_gateway_config
138+
store_gateway: {}
137139
table_manager:
138140
retention_deletes_enabled: false
139141
retention_period: 0s
@@ -150,11 +152,15 @@ config:
150152
querier:
151153
active_query_tracker_dir: /data/cortex/querier
152154
query_ingesters_within: 12h
153-
# Comma separated list of store-gateway addresses in DNS Service Discovery
154-
# format. This option should be set when using the blocks storage and the
155+
# -- Comma separated list of store-gateway addresses in DNS Service Discovery
156+
# format. This option should is set automatically when using the blocks storage and the
155157
# store-gateway sharding is disabled (when enabled, the store-gateway instances
156158
# form a ring and addresses are picked from the ring).
157-
# store_gateway_addresses: 'dns+{{ include "cortex.storeGatewayFullname" $ }}-headless:9095'
159+
# @default -- automatic
160+
store_gateway_addresses: |-
161+
{{ if and (eq .Values.config.storage.engine "blocks") (not .Values.config.store_gateway.sharding_enabled) -}}
162+
dns+{{ include "cortex.storeGatewayFullname" $ }}-headless:9095
163+
{{- end }}
158164
query_range:
159165
split_queries_by_interval: 24h
160166
align_queries_with_step: true

0 commit comments

Comments
 (0)