I am trying to have heartbeat deployed in kubernetes as a daemonset in which each heartbeat daemon icmp pings all other nodes in a cluster. I was planning on doing this with the kubernetes autodiscover provider however I have been unsuccessful in getting it to recognize and ping more than just the pod on the same node. Can someone point me at a configuration that the provider recognizes all nodes in a cluster rather than just the node the daemon is running on.
My heartbeat configuration resembles this:
fields:
site.name: testcluster
fields_under_root: true
heartbeat.config.monitors:
# Directory + glob pattern to search for configuration files
path: /usr/share/heartbeat/monitors.d/*.yml
# If enabled, heartbeat will periodically check the config.monitors path for changes
reload.enabled: true
# How often to check for changes
reload.period: 15s
logging.json: true
heartbeat.autodiscover:
providers:
- type: kubernetes
include_labels: "k8s-app"
# host: ${NODE_NAME}
# namespace: test-heartbeat
templates:
- condition:
contains:
kubernetes.labels.k8s-app: heartbeat
config:
- type: icmp
hosts: ["${data.kubernetes.node.name}"]
schedule: '*/5 * * * * * *'
mode: all
ipv4: true
timeout: 16s
wait: 1s