#!/usr/bin/env bash for i in $(kubectl get nodes | sed -nr 's/^(k[^ ]+) .*/\1/p'); do ssh root@$i pkill node_exporter done