Borislav Grigorov
10/24/2023, 12:32 AMalertmanager:
# Using the config, alertmanager.yml file is created.
# We no longer need the config file as query services
# delivers the required config.
extraArgs:
config.file: /etc/alertmanager/alertmanager.yml
log.level: debug
config:
global:
resolve_timeout: 1m
templates:
- '/etc/alertmanager/*.tmpl'
receivers:
- name: 'slack-notifications'
slack_configs:
- channel: '#alert-test'
api_url: ************
send_resolved: true
title: '{{`{{ template "slack.title" . }}`}}'
text: '{{`{{ template "slack.text" . }}`}}'
route:
receiver: 'slack-notifications'
# Templates are no longer needed as they are included
# from frontend placeholder while creating alert channels.
templates:
title.tmpl: |-
{{`
{{ define "slack.title" }}
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} for {{ .CommonLabels.job }}
{{- if gt (len .CommonLabels) (len .GroupLabels) -}}
{{" "}}(
{{- with .CommonLabels.Remove .GroupLabels.Names }}
{{- range $index, $label := .SortedPairs -}}
{{ if $index }}, {{ end }}
{{- $label.Name }}="{{ $label.Value -}}"
{{- end }}
{{- end -}}
)
{{- end }}
{{ end }}
`}}
text.tmpl: |-
{{`
{{ define "slack.text" }}
{{ range .Alerts -}}
*Alert:* {{ .Labels.alertname }}{{ if .Labels.severity }} - *{{ .Labels.severity }}*{{ end }}
*Summary:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* `}}`{{`{{ .Value }}`}}`{{`
{{ end }}
{{ end }}
{{ end }}
`}}
configmapReload:
## If false, the configmap-reload container will not be deployed
##
enabled: true
If I add or remove the extra args I still cannot get the config to reload. The alertmanager pod starts up but has only the default receiver and not my receiver.Borislav Grigorov
10/27/2023, 8:26 AMSrikanth Chekuri
10/27/2023, 11:56 AM