In order to have alerts dispatched to your receiver(s) of choice,
a configuration file
must be provided to Alertmanager using the
config_file
option:
juju config alertmanager-k8s \
config_file='@path/to/alertmanager.yml'
Note that if you use templates, you should use the templates_file
config option
instead of having a templates
section in your yaml
configuration file.
(This is a slight deviation from the official alertmanager config spec.)
Use the templates_file
option to push templates that are being used by the configuration file:
juju config alertmanager-k8s \
config_file='@path/to/alertmanager.yml' \
templates_file='@path/to/templates.tmpl'
All templates need to go into this single config option, instead of the ‘templates’ section of the main configuration file. The templates will be pushed to the workload container, and the configuration file will be updated accordingly.
Refer to the official templates documentation for more details.
To verify Alertmanager is using the expected configuration you can use the
show-config
action:
juju run-action alertmanager-k8s/0 show-config --wait