Skip to content

Commit 898ec7d

Browse files
authored
introduce cortex-helm-chart wiki (grafana#208)
* introduce cortex-helm-chart wiki Signed-off-by: ShuzZzle <[email protected]> * remove unused file Signed-off-by: ShuzZzle <[email protected]>
1 parent 52f3fae commit 898ec7d

20 files changed

+713
-195
lines changed

Chart.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ home: https://cortexmetrics.io/
66
icon: https://avatars2.githubusercontent.com/u/43045022?s=200&v=4
77
kubeVersion: ^1.19.0-0
88
maintainers:
9-
10-
name: Cortex Maintainers
9+
10+
name: Tom Hayward
11+
url: https://github.com/kd7lxl
12+
13+
name: Niclas Schad
14+
url: https://github.com/ShuzZzle
1115
name: cortex
1216
sources:
1317
- https://github.com/cortexproject/cortex-helm-chart

README.md

Lines changed: 6 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ Horizontally scalable, highly available, multi-tenant, long term Prometheus.
1212

1313
| Name | Email | Url |
1414
| ---- | ------ | --- |
15-
| Cortex Maintainers | [email protected] | |
15+
| Tom Hayward | [email protected] | https://github.com/kd7lxl |
16+
| Niclas Schad | [email protected] | https://github.com/ShuzZzle |
17+
18+
## Documentation
19+
20+
Checkout our documentation for the cortex-helm-chart [here](https://cortexproject.github.io/cortex-helm-chart/)
1621

1722
## Dependencies
1823

@@ -75,102 +80,6 @@ Note that it might be necessary to use `--reset-values` since some default value
7580

7681
Source code can be found [here](https://cortexmetrics.io/)
7782

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:
141-
```yaml
142-
apiVersion: v1
143-
kind: ConfigMap
144-
metadata:
145-
annotations:
146-
k8s-sidecar-target-directory: /data/fake
147-
labels:
148-
cortex_alertmanager: "1"
149-
name: alertmanager-example-config
150-
data:
151-
fake.yaml: |-
152-
global:
153-
resolve_timeout: 5m
154-
http_config: {}
155-
smtp_hello: localhost
156-
smtp_require_tls: true
157-
route:
158-
receiver: team-X-mails
159-
group_by:
160-
- alertname
161-
routes:
162-
- receiver: "null"
163-
match:
164-
alertname: Watchdog
165-
group_wait: 30s
166-
group_interval: 5m
167-
repeat_interval: 12h
168-
receivers:
169-
- name: 'team-X-mails'
170-
email_configs:
171-
172-
```
173-
17483
## Requirements
17584

17685
Kubernetes: `^1.19.0-0`

README.md.gotmpl

Lines changed: 4 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
{{ template "chart.maintainersSection" . }}
1313

14+
## Documentation
15+
16+
Checkout our documentation for the cortex-helm-chart [here](https://cortexproject.github.io/cortex-helm-chart/)
17+
1418
## Dependencies
1519

1620
### Key-Value store
@@ -73,102 +77,6 @@ Note that it might be necessary to use `--reset-values` since some default value
7377

7478
Source code can be found [here](https://cortexmetrics.io/)
7579

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:
139-
```yaml
140-
apiVersion: v1
141-
kind: ConfigMap
142-
metadata:
143-
annotations:
144-
k8s-sidecar-target-directory: /data/fake
145-
labels:
146-
cortex_alertmanager: "1"
147-
name: alertmanager-example-config
148-
data:
149-
fake.yaml: |-
150-
global:
151-
resolve_timeout: 5m
152-
http_config: {}
153-
smtp_hello: localhost
154-
smtp_require_tls: true
155-
route:
156-
receiver: team-X-mails
157-
group_by:
158-
- alertname
159-
routes:
160-
- receiver: "null"
161-
match:
162-
alertname: Watchdog
163-
group_wait: 30s
164-
group_interval: 5m
165-
repeat_interval: 12h
166-
receivers:
167-
- name: 'team-X-mails'
168-
email_configs:
169-
170-
```
171-
17280
{{ template "chart.requirementsSection" . }}
17381

17482

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_site
2+
.sass-cache
3+
.jekyll-cache
4+
.jekyll-metadata
5+
vendor

docs/404.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
permalink: /404.html
3+
layout: default
4+
---
5+
6+
<style type="text/css" media="screen">
7+
.container {
8+
margin: 10px auto;
9+
max-width: 600px;
10+
text-align: center;
11+
}
12+
h1 {
13+
margin: 30px 0;
14+
font-size: 4em;
15+
line-height: 1;
16+
letter-spacing: -1px;
17+
}
18+
</style>
19+
20+
<div class="container">
21+
<h1>404</h1>
22+
23+
<p><strong>Page not found :(</strong></p>
24+
<p>The requested page could not be found.</p>
25+
</div>

docs/Gemfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
source "https://rubygems.org"
2+
# Hello! This is where you manage which Jekyll version is used to run.
3+
# When you want to use a different version, change it below, save the
4+
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
5+
#
6+
# bundle exec jekyll serve
7+
#
8+
# This will help ensure the proper Jekyll version is running.
9+
# Happy Jekylling!
10+
# gem "jekyll", "~> 4.2.0"
11+
# This is the default theme for new Jekyll sites. You may change this to anything you like.
12+
gem "minima", "~> 2.5"
13+
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
14+
# uncomment the line below. To upgrade, run `bundle update github-pages`.
15+
gem "github-pages","~> 219", group: :jekyll_plugins
16+
gem "just-the-docs"
17+
# If you have any plugins, put them here!
18+
group :jekyll_plugins do
19+
gem "jekyll-feed", "~> 0.12"
20+
end
21+
22+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
23+
# and associated library.
24+
platforms :mingw, :x64_mingw, :mswin, :jruby do
25+
gem "tzinfo", "~> 1.2"
26+
gem "tzinfo-data"
27+
end
28+
29+
# Performance-booster for watching directories on Windows
30+
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
31+

0 commit comments

Comments
 (0)