AlertManager发送告警
2024-11-01
ALertManager 发送消息
PrometheusAlert
一个开源的对接AlertManager
告警发送的项目
配置
配置 Deployment
## PrometheusAlert 使用的 Sqlite 存储数据,镜像中自带数据库,我们可以持久化一下
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: feishu-pvc
namespace: monitoring
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi # 申请的存储大小
storageClassName: cfs-storageclass
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: feishu
namespace: monitoring
spec:
selector:
matchLabels:
app: feishu
template:
metadata:
labels:
app: feishu
spec:
containers:
- name: feishu
image: feiyu563/prometheus-alert:v4.9.1
env:
- name: PA_LOGIN_USER
value: prometheusalert
- name: PA_LOGIN_PASSWORD
value: prometheusalert
- name: PA_OPEN_FEISHU
value: "1"
volumeMounts:
- mountPath: /app/db
name: feishu-volume
volumes:
- name: feishu-volume
persistentVolumeClaim:
claimName: feishu-pvc
---
apiVersion: v1
kind: Service
metadata:
name: feishu
namespace: monitoring
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: feishu
type: NodePort
根据如下配置即可完成飞书告警