What are some good tools for executing commands across multiple Kubernetes clusters?

0
13
Asked By CuriousCoder99 On

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

Answered By ArgoFan99 On

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.

Answered By BashWizard42 On

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!

Answered By TechSavvyJohn On

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!

MetricNerd77 -

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

Answered By DevEnthusiast88 On

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!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.