Skip to content

Commit dad631e

Browse files
committed
Populate config.querier.store_gateway_addresses automatically
Signed-off-by: Tom Hayward <[email protected]>
1 parent f6454e5 commit dad631e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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 be set 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 | `{}` | |
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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ config:
134134
expiration: 1h
135135
memcached_client:
136136
timeout: 1s
137+
store_gateway: {}
137138
table_manager:
138139
retention_deletes_enabled: false
139140
retention_period: 0s
@@ -150,11 +151,15 @@ config:
150151
querier:
151152
active_query_tracker_dir: /data/cortex/querier
152153
query_ingesters_within: 12h
153-
# Comma separated list of store-gateway addresses in DNS Service Discovery
154+
# -- Comma separated list of store-gateway addresses in DNS Service Discovery
154155
# format. This option should be set when using the blocks storage and the
155156
# store-gateway sharding is disabled (when enabled, the store-gateway instances
156157
# form a ring and addresses are picked from the ring).
157-
# store_gateway_addresses: 'dns+{{ include "cortex.storeGatewayFullname" $ }}-headless:9095'
158+
# @default -- automatic
159+
store_gateway_addresses: |-
160+
{{ if and (eq .Values.config.storage.engine "blocks") (not .Values.config.store_gateway.sharding_enabled) -}}
161+
dns+{{ include "cortex.storeGatewayFullname" $ }}-headless:9095
162+
{{- end }}
158163
query_range:
159164
split_queries_by_interval: 24h
160165
align_queries_with_step: true

0 commit comments

Comments
 (0)