add settings alert for slack

Signed-off-by: Alexey Artamonov <scooby18@yandex.ru>
This commit is contained in:
Alexey Artamonov
2025-10-21 20:50:58 +03:00
parent d1fa0e6586
commit 82cebe3ad7
5 changed files with 37 additions and 3 deletions

View File

@@ -72,6 +72,8 @@
| `alerta.alerts.telegram.token` | Telegram token for your bot | `string` | `""` |
| `alerta.alerts.telegram.chatID` | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string` | `""` |
| `alerta.alerts.telegram.disabledSeverity` | List of severity without alerts, separated by comma like: "informational,warning" | `string` | `""` |
| `alerta.alerts.slack` | Configuration for Slack alerts | `*object` | `null` |
| `alerta.alerts.slack.url` | Configuration uri for Slack alerts | `*string` | `""` |
### Grafana configuration

View File

@@ -109,9 +109,20 @@ spec:
- name: AUTH_REQUIRED
value: "True"
{{- $plugins := list }}
{{- if and .Values.alerta.alerts.telegram.chatID .Values.alerta.alerts.telegram.token }}
{{- $plugins = append $plugins "telegram" }}
{{- end }}
{{- if .Values.alerta.alerts.slack.url }}
{{- $plugins = append $plugins "slack" }}
{{- end }}
{{- if gt (len $plugins) 0 }}
- name: "PLUGINS"
value: "telegram"
value: "{{ default "" (join "," $plugins) }}"
{{- end }}
{{- if and .Values.alerta.alerts.telegram.chatID .Values.alerta.alerts.telegram.token }}
- name: TELEGRAM_CHAT_ID
value: "{{ .Values.alerta.alerts.telegram.chatID }}"
- name: TELEGRAM_TOKEN
@@ -122,6 +133,11 @@ spec:
value: "{{ .Values.alerta.alerts.telegram.disabledSeverity }}"
{{- end }}
{{- if .Values.alerta.alerts.slack.url }}
- name: "SLACK_WEBHOOK_URL"
value: "{{ .Values.alerta.alerts.slack.url }}"
{{- end }}
ports:
- name: http
containerPort: 8080

View File

@@ -12,6 +12,17 @@
"type": "object",
"default": {},
"properties": {
"slack": {
"description": "Configuration for Slack alerts",
"type": "object",
"default": {},
"properties": {
"url": {
"description": "Configuration uri for Slack alerts",
"type": "string"
}
}
},
"telegram": {
"description": "Configuration for Telegram alerts",
"type": "object",

View File

@@ -90,6 +90,8 @@ logsStorages:
## @field telegramAlerts.token {string} Telegram token for your bot
## @field telegramAlerts.chatID {string} Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot
## @field telegramAlerts.disabledSeverity {string} List of severity without alerts, separated by comma like: "informational,warning"
## @field alerts.slack {*slackAlerts} Configuration for Slack alerts
## @field slackAlerts.url {*string} Configuration uri for Slack alerts
alerta:
storage: 10Gi
storageClassName: ""
@@ -112,6 +114,9 @@ alerta:
chatID: ""
disabledSeverity: ""
slack:
url: ""
## @section Grafana configuration
## @param grafana {grafana} Configuration for Grafana

File diff suppressed because one or more lines are too long