Skip to content

Commit afba1e0

Browse files
authored
support runtime configuration (grafana#209)
* support runtime configuration Signed-off-by: Tom Hayward <[email protected]> * support managing the runtime config cm outside helm, support annotations Signed-off-by: Tom Hayward <[email protected]>
1 parent 2564694 commit afba1e0

16 files changed

+93
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## master / unreleased
44

5+
* [FEATURE] Support runtime configuration #209
56
* [FEATURE] Add autoscaler for queriers #190
67
* [FEATURE] Add autoscaler for distributors #189
78
* [FEATURE] Add autoscaler for ingesters #182

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ Kubernetes: `^1.19.0-0`
340340
| config.&ZeroWidthSpace;ruler.&ZeroWidthSpace;enable_alertmanager_discovery | bool | `false` | |
341341
| config.&ZeroWidthSpace;ruler.&ZeroWidthSpace;enable_api | bool | `false` | Enable the experimental ruler config api. |
342342
| config.&ZeroWidthSpace;ruler.&ZeroWidthSpace;storage | object | `{}` | Method to use for backend rule storage (configdb, azure, gcs, s3, swift, local) refer to https://cortexmetrics.io/docs/configuration/configuration-file/#ruler_config |
343+
| config.&ZeroWidthSpace;runtime_config.&ZeroWidthSpace;file | string | `"/etc/cortex-runtime-config/runtime_config.yaml"` | |
343344
| config.&ZeroWidthSpace;schema.&ZeroWidthSpace;configs[0].&ZeroWidthSpace;chunks.&ZeroWidthSpace;period | string | `"168h"` | |
344345
| config.&ZeroWidthSpace;schema.&ZeroWidthSpace;configs[0].&ZeroWidthSpace;chunks.&ZeroWidthSpace;prefix | string | `"chunks_"` | |
345346
| config.&ZeroWidthSpace;schema.&ZeroWidthSpace;configs[0].&ZeroWidthSpace;from | string | `"2020-11-01"` | |
@@ -777,6 +778,9 @@ Kubernetes: `^1.19.0-0`
777778
| ruler.&ZeroWidthSpace;strategy.&ZeroWidthSpace;type | string | `"RollingUpdate"` | |
778779
| ruler.&ZeroWidthSpace;terminationGracePeriodSeconds | int | `180` | |
779780
| ruler.&ZeroWidthSpace;tolerations | list | `[]` | |
781+
| runtimeconfigmap.&ZeroWidthSpace;annotations | object | `{}` | |
782+
| runtimeconfigmap.&ZeroWidthSpace;create | bool | `true` | If true, a configmap for the `runtime_config` will be created. If false, the configmap _must_ exist already on the cluster or pods will fail to create. |
783+
| runtimeconfigmap.&ZeroWidthSpace;runtime_config | object | `{}` | https://cortexmetrics.io/docs/configuration/arguments/#runtime-configuration-file |
780784
| serviceAccount.&ZeroWidthSpace;annotations | object | `{}` | |
781785
| serviceAccount.&ZeroWidthSpace;automountServiceAccountToken | bool | `true` | |
782786
| serviceAccount.&ZeroWidthSpace;create | bool | `true` | |

templates/alertmanager/alertmanager-dep.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ spec:
116116
{{- end }}
117117
- name: config
118118
mountPath: /etc/cortex
119+
- name: runtime-config
120+
mountPath: /etc/cortex-runtime-config
119121
- name: storage
120122
mountPath: "/data"
121123
subPath: {{ .Values.alertmanager.persistence.subPath }}
@@ -162,6 +164,9 @@ spec:
162164
{{- if .Values.alertmanager.extraVolumes }}
163165
{{ toYaml .Values.alertmanager.extraVolumes | indent 8}}
164166
{{- end }}
167+
- name: runtime-config
168+
configMap:
169+
name: {{ template "cortex.fullname" . }}-runtime-config
165170
- name: storage
166171
emptyDir: {}
167172
{{- end -}}

templates/alertmanager/alertmanager-statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ spec:
8989
{{- else }}
9090
secretName: {{ template "cortex.fullname" . }}
9191
{{- end }}
92+
- name: runtime-config
93+
configMap:
94+
name: {{ template "cortex.fullname" . }}-runtime-config
9295
{{- if not .Values.alertmanager.persistentVolume.enabled }}
9396
- name: storage
9497
emptyDir: {}
@@ -170,6 +173,8 @@ spec:
170173
{{- end }}
171174
- name: config
172175
mountPath: /etc/cortex
176+
- name: runtime-config
177+
mountPath: /etc/cortex-runtime-config
173178
- name: storage
174179
mountPath: "/data"
175180
{{- if .Values.alertmanager.persistentVolume.subPath }}

templates/compactor/compactor-statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ spec:
8888
{{- else }}
8989
secretName: {{ template "cortex.fullname" . }}
9090
{{- end }}
91+
- name: runtime-config
92+
configMap:
93+
name: {{ template "cortex.fullname" . }}-runtime-config
9194
{{- if not .Values.compactor.persistentVolume.enabled }}
9295
- name: storage
9396
emptyDir: {}
@@ -115,6 +118,8 @@ spec:
115118
{{- end }}
116119
- name: config
117120
mountPath: /etc/cortex
121+
- name: runtime-config
122+
mountPath: /etc/cortex-runtime-config
118123
- name: storage
119124
mountPath: "/data"
120125
{{- if .Values.compactor.persistentVolume.subPath }}

templates/configs/configs-dep.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ spec:
6868
- name: config
6969
mountPath: /etc/cortex
7070
subPath: {{ .Values.configs.persistence.subPath }}
71+
- name: runtime-config
72+
mountPath: /etc/cortex-runtime-config
7173
{{- if .Values.configsdb_postgresql.enabled }}
7274
- name: postgres-password
7375
mountPath: /etc/postgresql
@@ -123,6 +125,9 @@ spec:
123125
- key: {{ if .Values.configsdb_postgresql.auth.existing_secret.name }}{{ .Values.configsdb_postgresql.auth.existing_secret.key }}{{ else }}postgresql-password{{ end }}
124126
path: password
125127
{{- end }}
128+
- name: runtime-config
129+
configMap:
130+
name: {{ template "cortex.fullname" . }}-runtime-config
126131
{{- if .Values.configs.extraVolumes }}
127132
{{ toYaml .Values.configs.extraVolumes | indent 8}}
128133
{{- end }}

templates/distributor/distributor-dep.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ spec:
6666
{{- end }}
6767
- name: config
6868
mountPath: /etc/cortex
69+
- name: runtime-config
70+
mountPath: /etc/cortex-runtime-config
6971
- name: storage
7072
mountPath: "/data"
7173
subPath: {{ .Values.distributor.persistence.subPath }}
@@ -112,6 +114,9 @@ spec:
112114
{{- else }}
113115
secretName: {{ template "cortex.fullname" . }}
114116
{{- end }}
117+
- name: runtime-config
118+
configMap:
119+
name: {{ template "cortex.fullname" . }}-runtime-config
115120
{{- if .Values.distributor.extraVolumes }}
116121
{{ toYaml .Values.distributor.extraVolumes | indent 8}}
117122
{{- end }}

templates/ingester/ingester-dep.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ spec:
6868
{{- end }}
6969
- name: config
7070
mountPath: /etc/cortex
71+
- name: runtime-config
72+
mountPath: /etc/cortex-runtime-config
7173
- name: storage
7274
mountPath: "/data"
7375
{{- if .Values.ingester.persistentVolume.subPath }}
@@ -125,6 +127,9 @@ spec:
125127
{{- else }}
126128
secretName: {{ template "cortex.fullname" . }}
127129
{{- end }}
130+
- name: runtime-config
131+
configMap:
132+
name: {{ template "cortex.fullname" . }}-runtime-config
128133
{{- if .Values.ingester.extraVolumes }}
129134
{{ toYaml .Values.ingester.extraVolumes | nindent 8}}
130135
{{- end }}

templates/ingester/ingester-statefulset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ spec:
9090
{{- else }}
9191
secretName: {{ template "cortex.fullname" . }}
9292
{{- end }}
93+
- name: runtime-config
94+
configMap:
95+
name: {{ template "cortex.fullname" . }}-runtime-config
9396
{{- if not .Values.ingester.persistentVolume.enabled }}
9497
- name: storage
9598
emptyDir: {}
@@ -117,6 +120,8 @@ spec:
117120
{{- end }}
118121
- name: config
119122
mountPath: /etc/cortex
123+
- name: runtime-config
124+
mountPath: /etc/cortex-runtime-config
120125
- name: storage
121126
mountPath: "/data"
122127
{{- if .Values.ingester.persistentVolume.subPath }}

templates/querier/querier-dep.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ spec:
6666
{{- end }}
6767
- name: config
6868
mountPath: /etc/cortex
69+
- name: runtime-config
70+
mountPath: /etc/cortex-runtime-config
6971
- name: storage
7072
mountPath: "/data"
7173
subPath: {{ .Values.querier.persistence.subPath }}
@@ -106,6 +108,9 @@ spec:
106108
{{- else }}
107109
secretName: {{ template "cortex.fullname" . }}
108110
{{- end }}
111+
- name: runtime-config
112+
configMap:
113+
name: {{ template "cortex.fullname" . }}-runtime-config
109114
{{- if .Values.querier.extraVolumes }}
110115
{{ toYaml .Values.querier.extraVolumes | indent 8}}
111116
{{- end }}

0 commit comments

Comments
 (0)