Skip to content

Commit fa39072

Browse files
authored
feat(mo-ob): support k8s events observability (#21)
## What type of PR is this? * [x] Feature * [ ] BUG * [ ] Alerts * [ ] Improvement * [ ] Documentation * [ ] Test and CI ## Which issue(s) this PR related: issue # https://github.com/matrixorigin/MO-Cloud/issues/1638 ## What this PR does / why we need it: 1. 添加 grafana alloy 作为 mo-ob-opensource 的子chart部署 2. grafana alloy values 默认配置采集全部 namespace 的 event 并发送到 loki
1 parent 4a56589 commit fa39072

File tree

5 files changed

+65
-3
lines changed

5 files changed

+65
-3
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ kubectl get secret -n ${OBNS} grafana-admin-secret -o jsonpath="{.data['admin-p
139139
# 进阶配置
140140

141141

142+
## 需要替换的镜像源
143+
144+
如果部署的时候发现 image pull failed 等错误,需要替换镜像源(如阿里云),这些被替换的镜像都已经显示的写在了 chart 的 values.yaml 下,如 `charts/mo-ob-opensource/values.yaml`
145+
146+
```
147+
alloy:
148+
image:
149+
registry: "docker.io"
150+
repository: grafana/alloy
151+
tag: v1.3.1
152+
```
153+
将对应的镜像 push 到需要替换的镜像源仓库即可部署
154+
155+
142156
## alertmanger 打开 web 鉴权
143157

144158
1.在 `charts/mo-ruler-stack/values.yaml` 下设置 secretValue.alertmanager,alertmanager_web_auth_password_bcrypted 是 alertmanager_web_auth_password 的 bcrypt 加密

charts/mo-ob-opensource/Chart.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: mo-ob-opensource
33
description: mo-ob-opensource's Helm chart for Kubernetes
44
type: application
5-
version: 1.0.4
5+
version: 1.0.5
66
appVersion: 0.9.0
77
dependencies:
88
- condition: kube-prometheus-stack.enabled
@@ -17,3 +17,7 @@ dependencies:
1717
name: promtail
1818
repository: https://grafana.github.io/helm-charts
1919
version: 6.15.1
20+
- condition: alloy.enabled
21+
name: alloy
22+
repository: https://grafana.github.io/helm-charts
23+
version: 0.6.1

charts/mo-ob-opensource/values.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,41 @@ defaultDatasource:
1313
# cooperate with template templates/loki-datasource.yaml
1414
loki: true
1515

16+
# alloy for k8s events
17+
alloy:
18+
19+
image:
20+
registry: "docker.io"
21+
repository: grafana/alloy
22+
tag: v1.3.1
23+
configReloader:
24+
enabled: true
25+
image:
26+
registry: "ghcr.io"
27+
repository: jimmidyson/configmap-reload
28+
tag: v0.12.0
29+
enabled: true
30+
alloy:
31+
resources:
32+
limits:
33+
cpu: 500m
34+
memory: 512Mi
35+
requests:
36+
cpu: 200m
37+
memory: 200Mi
38+
configMap:
39+
# -- Content to assign to the new ConfigMap. This is passed into `tpl` allowing for templating from values.
40+
content: |
41+
loki.source.kubernetes_events "k8s_event" {
42+
forward_to = [loki.write.local.receiver]
43+
}
44+
45+
loki.write "local" {
46+
endpoint {
47+
url = "http://{{ .Release.Name }}-loki-gateway/loki/api/v1/push"
48+
}
49+
}
50+
1651
promtail:
1752
enabled: true
1853
serviceMonitor:
@@ -97,6 +132,15 @@ loki:
97132
# retention related issue: https://github.com/matrixone-cloud/observability/issues/86
98133
retention_deletes_enabled: true
99134
retention_period: 720h
135+
lokiCanary:
136+
enabled: false
137+
138+
chunksCache:
139+
enabled: false
140+
141+
resultsCache:
142+
enabled: false
143+
100144
loki:
101145
# -- Defines what kind of object stores the configuration, a ConfigMap or a Secret.
102146
# In order to move sensitive information (such as credentials) from the ConfigMap/Secret to a more secure location (e.g. vault), it is possible to use [environment variables in the configuration](https://grafana.com/docs/loki/latest/configuration/#use-environment-variables-in-the-configuration).

dev/mo-ob-opensource.dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ loki:
9191
cpu: "2000m"
9292

9393
kube-prometheus-stack:
94-
enabled: false
94+
enabled: true
9595
prometheus:
9696
prometheusSpec:
9797
resources:

dev/mo-ruler-stack.dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ alertmanager:
6868
- name: "null"
6969
- name: 'wecom-group'
7070
webhook_configs:
71-
- url: "http://alertmanager-webhook-adapter/webhook/send?channel_type=weixin&token=ca66171c-cc72-4f88-abd5-c6802df203bd"
71+
- url: "http://alertmanager-webhook-adapter/webhook/send?channel_type=weixin&token=<token>"
7272

7373
grafana:
7474
persistence:

0 commit comments

Comments
 (0)