貔貅云原生

貔貅云原生

AlertManager发送告警

15
0
0
2024-11-01
AlertManager发送告警

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

根据如下配置即可完成飞书告警

bfb5675734dd976190792636942b78d.png

e1dbcb92aee9688e5409d15f60b9b56.png

e3425969a4a97fb3086c2585b65adcc.png