apiVersion: v1 kind: Secret type: Opaque metadata: name: altermanager-email-credentials namespace: freeleaps-monitoring-system data: password: cHducGNya3d0aXp5Z2RoZQ== --- apiVersion: monitoring.coreos.com/v1alpha1 kind: AlertmanagerConfig metadata: name: alertmanager-config namespace: freeleaps-monitoring-system spec: receivers: # - msteamsConfigs: # - sendResolved: true # text: '{{ template "msteams.default.text" . }}' # title: >- # {{ if eq .Status "firing" }}π¨ [FIRING] π₯{{- else -}}π [RESOLVED] # π»{{- end -}} # webhookUrl: # key: webhook-url # name: freeleaps-teams-webhook # name: ms-teams - emailConfigs: - to: "1535145760@qq.com,icecheng@mathmast.com" from: "1535145760@qq.com" smarthost: "smtp.qq.com:465" authUsername: "1535145760@qq.com" authPassword: name: "altermanager-email-credentials" key: "password" authIdentity: "1535145760@qq.com" requireTLS: false sendResolved: true headers: - key: Subject value: 'π¨Freeleaps Alert: {{ .CommonAnnotations.summary }}' html: |-
π Description: {{ .CommonAnnotations.description }}
{{ if eq .Status "firing" }}π΄ Status: {{ .Status | toUpper }}{{ else }}π’ Status: {{ .Status | toUpper }}{{ end }}
π Runbook: {{ .CommonAnnotations.runbook_url }}
name: email route: groupBy: - severity groupInterval: 30s receiver: email groupWait: 30s repeatInterval: 1m