Skip to content

A small tool written in Go to display some Kubernetes cluster info on-the-fly

Notifications You must be signed in to change notification settings

mikejoh/k8s-cluster-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Kubernetes cluster info tool

This tool is a quick and dirty test of the client-go package (for Go clients talking to a Kubernetes cluster), at the moment this tool will fetch the number of pods, deployments and services in each namespace and then print this information to the user.

API authentication method are out of cluster and you need your kubeconfig file that holds the context information to initialize a client. The same file that kubectl uses.

More info about client-go and how to use it in various ways can be found here.

This tool is not done yet and it can only get better!

Install

Use the provided Makefile and run make build, if you want to build a Linux binary you can run make build-linux.

Run

Example:

./k8sinfo
Namespace: default
        Pods: 2
        Deployments: 2
        Services: 3
Namespace: kube-public
        Pods: 0
        Deployments: 0
        Services: 0
Namespace: kube-system
        Pods: 10
        Deployments: 3
        Services: 2

Cluster totals:
        Pods: 12
        Deployments: 5
        Services: 5

About

A small tool written in Go to display some Kubernetes cluster info on-the-fly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published