Skip to content

Jsonnet library for configuring alertmanager and installing it on Kubernetes.

License

Notifications You must be signed in to change notification settings

crdsonnet/alertmanager-libsonnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alertmanager-libsonnet

This project provides a jsonnet library for configuring alertmanager and installing it on Kubernetes.

The alertmanagerConfig library is generated from a JSON schema derived from the Go structs in Alertmanager. The alertmanagerKube library is manually curated.

Example

local alertmanagerConfig = import 'github.com/crdsonnet/alertmanager-libsonnet/alertmanagerConfig/main.libsonnet';
local alertmanagerKube = import 'github.com/crdsonnet/alertmanager-libsonnet/alertmanagerKube/main.libsonnet';

local testReceiver =
  alertmanagerConfig.receivers.new('test')
  + alertmanagerConfig.receivers.withSlackConfigs([
    alertmanagerConfig.receivers.slack_configs.new('#general'),
  ])
  + alertmanagerConfig.receivers.withWebhookConfigs([
    alertmanagerConfig.receivers.webhook_configs.new('http://localhost/hot/new/webhook'),
  ]);

local config =
  alertmanagerConfig.withRoute([
    alertmanagerConfig.route.withReceiver(testReceiver.name),
  ])
  + alertmanagerConfig.withReceivers([
    testReceiver,
  ]);

alertmanagerKube.new()
+ alertmanagerKube.withConfig(config)

Docs

See docs to configure and install.

About

Jsonnet library for configuring alertmanager and installing it on Kubernetes.

Topics

Resources

License

Stars

Watchers

Forks

Languages