I'm managing hundreds of Kubernetes clusters and need to run commands in parallel on several of them. For instance, I may want to check the image version used in a deployment across multiple clusters, get expiry dates for specific certificate types, or identify clusters with nodes that have a certain taint. I'm currently using scripts that iterate over my kubeconfig files, but it's not very convenient. I'm looking for GUI tools that can help me select a handful or all clusters and run kubectl commands or scripts against them. I'd also love to know about options that allow running PromQL queries if anyone has experience with that. Any recommendations would be greatly appreciated!
4 Answers
Have you considered using tools like Argo or Flux? With Argo, you can use application sets to deploy the same version of an app to multiple clusters. You can even add variables for customization. Plus, setting up Grafana dashboards might help in gathering relevant info. For random one-off queries, though, I'm not quite sure what fits best.
For simple setups, you can just loop over the clusters using a straightforward Bash command. It’s so easy that you might not even need a dedicated script—just modify your existing commands a bit!
If you're looking for something like a one-off command tool, check out kubie. The `kubie exec` feature lets you specify patterns for cluster names and execute commands across them. But for more comprehensive monitoring, try to centralize your metrics, which will help with the queries you're asking about!
You could write a quick Bash script—like 5 to 10 lines. Here's a rough idea: get your cluster contexts using `kubectl config get-contexts -o json`, parse it into an array, and run your desired command in a loop over those contexts. It'll work pretty smoothly at scale!

Could you explain what you mean by centralized monitoring? I'm interested in implementing that. Thanks!