Skip to content

mdnix/kubectl-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-cluster

The kubectl-cluster plugin lets you run kubectl commands across a number of specified clusters. It is possible to run any kubectl command since this plugin is basically a wrapper around kubectl.

Install

Linux example:

git clone https://github.com/mdnix/kubectl-cluster.git
make compile
cp _out/linux/kubectl-cluster /usr/local/bin/

Usage

Define the cluster config

cat /home/marco/.clusters

clusters:
  - name: minikube
    config: /home/marco/.kube/config-mini
    tags: test
  - name: okd
    config: /home/marco/.kube/config-okd
    tags: prod

List available clusters

$ kubectl cluster list

Get Pods of all clusters using the current context

$ kubectl cluster run get pods 

Get Pods of all clusters, overriding the current namespace of the context

NOTE: When using flags for regular kubectl commands "--" has to be added to signify the end of command options

$ kubectl cluster run -- get pods --all-namespaces

Get Pods of specified clusters using the current context

$ kubectl cluster run --targets okd,minikube get pods 

Get Pods of clusters containing the specified tag in the config

$ kubectl cluster run --tags test get pods 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published