You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checkout our documentation for the cortex-helm-chart [here](https://cortexproject.github.io/cortex-helm-chart/)
16
21
17
22
## Dependencies
18
23
@@ -75,102 +80,6 @@ Note that it might be necessary to use `--reset-values` since some default value
75
80
76
81
Source code can be found [here](https://cortexmetrics.io/)
77
82
78
-
## Usage
79
-
### Rules and AlertManager configuration
80
-
Cortex can be configured to use a sidecar container in the Ruler and AlertManager to dynamically discover rules and AlertManager config/templates that are declared as ConfigMaps to allow easy and extensible configuration that avoids having to store state in the Cortex system itself (via config service, etc).
81
-
Put ConfigMaps into the specified namespace, and they are automatically detected and added as files to the Ruler and/or AlertManager containers, both of which are polling for changes on the filesystem and will make the new configurations go live dynamically.
82
-
This feature is disabled by default. Here is a simple example:
83
-
84
-
```yaml
85
-
ruler:
86
-
sidecar:
87
-
enabled: true
88
-
searchNamespace: cortex-rules
89
-
90
-
alertmanager:
91
-
sidecar:
92
-
enabled: true
93
-
searchNamespace: cortex-alertmanager
94
-
```
95
-
And here are the related configuration values in AlertManager and Ruler:
96
-
```yaml
97
-
config:
98
-
alertmanager:
99
-
data_dir: /data/
100
-
storage:
101
-
type : local
102
-
local:
103
-
path: /data
104
-
ruler:
105
-
rule_path: /data/rules
106
-
storage:
107
-
type : local
108
-
local:
109
-
directory: /tmp/rules
110
-
```
111
-
In AlertManager, the data_dir and local storage directory should be the same.
112
-
In the Ruler, there needs to be two separate volumes. One is read-only and serves as the location shared with the sidecar that contains all of the rules that were derived from configmaps (/tmp/rules). The other is read-write and used by the Ruler itself for its own management of rules, etc (/data).
113
-
Example ConfigMap containing a rule:
114
-
```yaml
115
-
kind: ConfigMap
116
-
metadata:
117
-
annotations:
118
-
k8s-sidecar-target-directory: /tmp/rules/fake
119
-
labels:
120
-
# Label cortex_rules must exist unless overridden by ruler.sidecar.label
121
-
cortex_rules: "1"
122
-
name: rules-cortex-9f99md47tc
123
-
namespace: cortex-rules
124
-
apiVersion: v1
125
-
data:
126
-
fake.yaml: |-
127
-
groups:
128
-
- name: fake-system-metrics
129
-
rules:
130
-
- alert: HighCPUusage
131
-
expr: avg(100 - rate(node_cpu_seconds_total{instance=~"qag1ge1l.+",mode="idle"}[5m]) * 100) by (instance) > 100
132
-
for: 3m
133
-
labels:
134
-
severity: warning
135
-
annotations:
136
-
description: Metrics from {{ $labels.job }} on {{ $labels.instance }} show CPU > 90% for 3m.
137
-
title: Node {{ $labels.instance }} has high CPU usage
138
-
139
-
```
140
-
Example ConfigMap containing an alertmanager-config:
Copy file name to clipboardExpand all lines: README.md.gotmpl
+4-96Lines changed: 4 additions & 96 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,10 @@
11
11
12
12
{{ template "chart.maintainersSection" . }}
13
13
14
+
## Documentation
15
+
16
+
Checkout our documentation for the cortex-helm-chart [here](https://cortexproject.github.io/cortex-helm-chart/)
17
+
14
18
## Dependencies
15
19
16
20
### Key-Value store
@@ -73,102 +77,6 @@ Note that it might be necessary to use `--reset-values` since some default value
73
77
74
78
Source code can be found [here](https://cortexmetrics.io/)
75
79
76
-
## Usage
77
-
### Rules and AlertManager configuration
78
-
Cortex can be configured to use a sidecar container in the Ruler and AlertManager to dynamically discover rules and AlertManager config/templates that are declared as ConfigMaps to allow easy and extensible configuration that avoids having to store state in the Cortex system itself (via config service, etc).
79
-
Put ConfigMaps into the specified namespace, and they are automatically detected and added as files to the Ruler and/or AlertManager containers, both of which are polling for changes on the filesystem and will make the new configurations go live dynamically.
80
-
This feature is disabled by default. Here is a simple example:
81
-
82
-
```yaml
83
-
ruler:
84
-
sidecar:
85
-
enabled: true
86
-
searchNamespace: cortex-rules
87
-
88
-
alertmanager:
89
-
sidecar:
90
-
enabled: true
91
-
searchNamespace: cortex-alertmanager
92
-
```
93
-
And here are the related configuration values in AlertManager and Ruler:
94
-
```yaml
95
-
config:
96
-
alertmanager:
97
-
data_dir: /data/
98
-
storage:
99
-
type : local
100
-
local:
101
-
path: /data
102
-
ruler:
103
-
rule_path: /data/rules
104
-
storage:
105
-
type : local
106
-
local:
107
-
directory: /tmp/rules
108
-
```
109
-
In AlertManager, the data_dir and local storage directory should be the same.
110
-
In the Ruler, there needs to be two separate volumes. One is read-only and serves as the location shared with the sidecar that contains all of the rules that were derived from configmaps (/tmp/rules). The other is read-write and used by the Ruler itself for its own management of rules, etc (/data).
111
-
Example ConfigMap containing a rule:
112
-
```yaml
113
-
kind: ConfigMap
114
-
metadata:
115
-
annotations:
116
-
k8s-sidecar-target-directory: /tmp/rules/fake
117
-
labels:
118
-
# Label cortex_rules must exist unless overridden by ruler.sidecar.label
119
-
cortex_rules: "1"
120
-
name: rules-cortex-9f99md47tc
121
-
namespace: cortex-rules
122
-
apiVersion: v1
123
-
data:
124
-
fake.yaml: |-
125
-
groups:
126
-
- name: fake-system-metrics
127
-
rules:
128
-
- alert: HighCPUusage
129
-
expr: avg(100 - rate(node_cpu_seconds_total{instance=~"qag1ge1l.+",mode="idle"}[5m]) * 100) by (instance) > 100
130
-
for: 3m
131
-
labels:
132
-
severity: warning
133
-
annotations:
134
-
description: Metrics from {{"{{ $labels.job }}"}} on {{"{{ $labels.instance }}"}} show CPU > 90% for 3m.
135
-
title: Node {{"{{ $labels.instance }}"}} has high CPU usage
136
-
137
-
```
138
-
Example ConfigMap containing an alertmanager-config:
0 commit comments