deadman-switch

by empathy.co

Helm chartv0.0.2App 1.0

A Helm chart for Kubernetes

About this chart

Dead mans Switch

A Helm chart based on Pingcap's dead-mans-switch for Prometheus' Alertmanager. This Helm chart does not modify the Pingcap's dead man's switch image in any way.

This Helm chart provides a simple way to install a dead man's switch for Alertmanager integrated with Pagerduty. A dead man's switch in Prometheus is a simple alert that is always firing, to test that the alerting pipeline is healthy. This dead man's switch integrates with Pagerduty, so that if this "always firing alert" is not firing (e.g. the "watchdog" alert from kube-prometheus-stack), a notification will be sent to Pagerduty.

Installation

To install the chart, run:

$ helm repo add empathy-public https://empathyco.github.io/helm-charts
$ helm install my-release empathy-public/deadman-switch

Configuration

Pingcap's dead-mans-switch is configured through a YAML file, mounted in the container as a secret in this Helm chart. The contents of this YAML file should be included in the secret parameter of the Helm chart values.yaml.

Alertmanager configuration

Taken from Pingcap's dead-mans-switch, Alertmanager should be configured as follows:

Create a route for the always firing alert in Alertmanager:

route:
  routes:
    - receiver: dead-mans-switch
      group_wait: 10s
      group_interval: 30s
      repeat_interval: 15s
      match:
        alertname: 'Watchdog'

Use the Kubernetes service as a webhook receiver:

receivers:
- name: dead-mans-switch
  webhook_configs:
  - url: http://<DEAD-MANS-SWITCH-SVC>:8080/webhook

Values

KeyTypeDefaultDescription
affinityobject{}Kubernetes pod affinity
fullnameOverridestring""Chart full name override
image.pullPolicystring"IfNotPresent"Image pullpolicy
image.repositorystring"gcr.io/pingcap-public/deadmansswitch"Image repository
image.tagstring"1.0"Image tag
imagePullSecretslist[]Image pull secrets
metrics.grafanaDashboard.enabledboolfalseCreate Grafana dashboard
metrics.grafanaDashboard.labelsobject{"grafana_dashboard":"1"}Grafana dashboards sidecar labels
metrics.grafanaDashboard.namespacestring"monitoring"Namespace for the Grafana dashboard
metrics.prometheusRule.enabledboolfalseif true, creates a Prometheus Operator PrometheusRule
metrics.prometheusRule.namespacestring""Namespace for the PrometheusRule Resource
metrics.prometheusRule.ruleslist[]Prometheus Rule definitions
metrics.prometheusRule.selectorobject{}Prometheus instance selector labels
metrics.serviceMonitor.enabledboolfalseif true, creates a Prometheus Operator ServiceMonitor
metrics.serviceMonitor.intervalstringnilInterval at which metrics should be scraped.
metrics.serviceMonitor.namespacestring""Namespace for the ServiceMonitor Resource (defaults to the Release Namespace).
metrics.serviceMonitor.scrapeTimeoutstringnilTimeout after which the scrape is ended
metrics.serviceMonitor.selectorobject{}Prometheus instance selector labels
nameOverridestring""Chart name override
nodeSelectorobject{}Kubernetes node selector
podAnnotationsobject{}Custom pod annotations
podSecurityContextobject{}Custom pod security context
replicaCountint1Number of deployment replicas
resourcesstringnilContainer resources
secretobject{"interval":"5m","notify":{"pagerduty":{"key":"your-pg-key"}}}Pingcap's dead-man-switch configuration as YAML. Please see https://github.com/pingcap/dead-mans-switch/blob/master/manifest/config.example.yaml
securityContextobject{}Custom container security context
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
tolerationslist[]Kubernetes tolerations

Autogenerated from chart metadata using helm-docs v1.5.0

Deploy deadman-switch with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has deadman-switch on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdeadman-switch is pinned at v0.0.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply