Skip to content

Instantly share code, notes, and snippets.

@raphaeldelio
Last active July 3, 2021 15:17
Show Gist options
  • Select an option

  • Save raphaeldelio/57a03bc6857e1d83912ea6c05c6e2837 to your computer and use it in GitHub Desktop.

Select an option

Save raphaeldelio/57a03bc6857e1d83912ea6c05c6e2837 to your computer and use it in GitHub Desktop.
Heartbeat for Kubernetes ConfigMap
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}'
@raphaeldelio
Copy link
Copy Markdown
Author

Shoulld emplates be templates?

Yes, thank you!

@raphaeldelio
Copy link
Copy Markdown
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