deadman-switch
by empathy.co
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
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | Kubernetes pod affinity |
| fullnameOverride | string | "" | Chart full name override |
| image.pullPolicy | string | "IfNotPresent" | Image pullpolicy |
| image.repository | string | "gcr.io/pingcap-public/deadmansswitch" | Image repository |
| image.tag | string | "1.0" | Image tag |
| imagePullSecrets | list | [] | Image pull secrets |
| metrics.grafanaDashboard.enabled | bool | false | Create Grafana dashboard |
| metrics.grafanaDashboard.labels | object | {"grafana_dashboard":"1"} | Grafana dashboards sidecar labels |
| metrics.grafanaDashboard.namespace | string | "monitoring" | Namespace for the Grafana dashboard |
| metrics.prometheusRule.enabled | bool | false | if true, creates a Prometheus Operator PrometheusRule |
| metrics.prometheusRule.namespace | string | "" | Namespace for the PrometheusRule Resource |
| metrics.prometheusRule.rules | list | [] | Prometheus Rule definitions |
| metrics.prometheusRule.selector | object | {} | Prometheus instance selector labels |
| metrics.serviceMonitor.enabled | bool | false | if true, creates a Prometheus Operator ServiceMonitor |
| metrics.serviceMonitor.interval | string | nil | Interval at which metrics should be scraped. |
| metrics.serviceMonitor.namespace | string | "" | Namespace for the ServiceMonitor Resource (defaults to the Release Namespace). |
| metrics.serviceMonitor.scrapeTimeout | string | nil | Timeout after which the scrape is ended |
| metrics.serviceMonitor.selector | object | {} | Prometheus instance selector labels |
| nameOverride | string | "" | Chart name override |
| nodeSelector | object | {} | Kubernetes node selector |
| podAnnotations | object | {} | Custom pod annotations |
| podSecurityContext | object | {} | Custom pod security context |
| replicaCount | int | 1 | Number of deployment replicas |
| resources | string | nil | Container resources |
| secret | object | {"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 |
| securityContext | object | {} | Custom container security context |
| serviceAccount.annotations | object | {} | Annotations to add to the service account |
| serviceAccount.create | bool | true | Specifies whether a service account should be created |
| serviceAccount.name | string | "" | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | [] | 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartdeadman-switch is pinned at v0.0.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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