mateimicu / kdiscover

Discover all K8s clusters on AWS, Google, etc ..
MIT License
10 stars 2 forks source link
aks cli eks gke golang kubeconfig kubeconfig-manager kubernetes

kdiscover

CI CodeQL codecov GitHub release (latest SemVer) GitHub go.mod Go version GitHub FOSSA Status Go Report Card

Kdiscover is a simple utility to list and configure access to all clusters it can find. The basic usecase revolves in having access to a lot of clusters but you still need to discover and export apposite kubeconfig.

Currently we suport only EKS clusters but there are plans to support othe k8s providers (GKE, AKE, etc ...)

Example

~ $ kubectl discover aws list
┌────────────────────────────────────────────────────────────────────────────────┐
│     cluster name                  region              status  exported locally │
├────────────────────────────────────────────────────────────────────────────────┤
│  1  production-us                 us-east-1           ACTIVE          No       │
│  2  production-eu                 eu-west-1           ACTIVE          No       │
│  3  dev-eu                        eu-central-1        ACTIVE          No       │
│  4  sandbox-eu                    eu-central-1        ACTIVE          No       │
├────────────────────────────────────────────────────────────────────────────────┤
│                                   number of clusters  4                        │
└────────────────────────────────────────────────────────────────────────────────┘
~ $ kubectl discover aws update
Update all EKS Clusters
Found 4 clusters remote
Backup kubeconfig to /Users/tuxy/.kube/config.bak
~ $ kubectl discover aws list
┌────────────────────────────────────────────────────────────────────────────────┐
│     cluster name                  region              status  exported locally │
├────────────────────────────────────────────────────────────────────────────────┤
│  1  production-us                 us-east-1           ACTIVE         Yes       │
│  2  production-eu                 eu-west-1           ACTIVE         Yes       │
│  3  dev-eu                        eu-central-1        ACTIVE         Yes       │
│  4  sandbox-eu                    eu-central-1        ACTIVE         Yes       │
├────────────────────────────────────────────────────────────────────────────────┤
│                                   number of clusters  4                        │
└────────────────────────────────────────────────────────────────────────────────┘

Columns in the list :

Install

Krew (Recommended)

Using the Krew plugin manager:

kubectl krew install discover

Note that in this context the command will need to invoked using kubectl discover.

macOs

You can also install a binary release on macOS using brew:

brew install mateimicu/tap/kdiscover
brew upgrade mateimicu/tap/kdiscover

Note that in this context the executable is name kdiscover.

Binary

You can download a specific version from the release page

Go

GO111MODULE=on go get github.com/mateimicu/kdiscover

Future Plans

Development is tracked in this board and we also have specific milestones

License

FOSSA Status