Last active
July 3, 2021 15:17
-
-
Save raphaeldelio/57a03bc6857e1d83912ea6c05c6e2837 to your computer and use it in GitHub Desktop.
Heartbeat for Kubernetes ConfigMap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: heartbeat-deployment-config | |
| namespace: monitoring | |
| labels: | |
| k8s-app: heartbeat | |
| data: | |
| heartbeat.yml: |- | |
| heartbeat.monitors: | |
| - type: icmp | |
| schedule: '*/5 * * * * * *' | |
| hosts: | |
| - "www.elastic.co" | |
| - "discuss.elastic.co" | |
| - "www.google.com" | |
| - "localhost" | |
| - type: http | |
| schedule: '@every 5s' | |
| name: Elastic Website | |
| urls: | |
| - "http://www.elastic.co" | |
| check.response: | |
| status: 301 | |
| body: | |
| - type: tcp | |
| name: Google DNS | |
| schedule: '@every 30s' | |
| hosts: | |
| - "8.8.8.8:53" | |
| heartbeat.autodiscover: | |
| providers: | |
| - type: kubernetes | |
| resource: node | |
| node: ${NODE_NAME} | |
| scope: cluster | |
| templates: | |
| # Example, check SSH port of all cluster nodes: | |
| - condition: ~ | |
| config: | |
| - hosts: | |
| - ${data.host}:22 | |
| name: ${data.kubernetes.node.name} | |
| schedule: '@every 10s' | |
| timeout: 5s | |
| type: tcp | |
| output.logstash: | |
| hosts: '${LOGSTASH_URL}' | |
Author
Author
Nice article, thanks for writing it.
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, thank you!