Skip to main content

I have been building, I use the term building loosely. I noticed there was a gap in the world of cloud and cloud native when it comes to gaining an inventory of all resources and objects in a specific platform or environment. 

The project is called Kollect, because we are going to collect the inventory using existing configuration on the system, there is no way to input credentials to access natively in the binary. The K is because this project started out with a focus on Kubernetes… and all Kubernetes app have to start with a K. That’s it! 

Who remembers RVtools? 

RVtools is useful tool known and loved across the VMware community which can quickly provide an inventory of your vSphere environment. I took this tool as the inspiration for my hacking something together. 

 

Getting Started 

You can get started with looking ath the project here.

You can either follow the readme instructions and this will involve building from source and this would require golang to be installed on the system you wish to run the binary. 

The second way is to download from the releases tab the correct binary for your system, my concern with this you will not get the browser experience (I need to work out why...) 

Either way you get the binary the next thing to understand is that by default if you just run 

./kollect

This is going to look in the default location on your system for the KUBECONFIG file and then display in the terminal the inventory of your Kubernetes cluster. 

If you wan to point to a specific KUBECONFIG you can do this with 

./kollect --kubeconfig ~/.kube/config

If you would like to export this JSON format out to a file you can do this with 

./kollect --output my-k8s-inventory

Ok, what about a more visual vs this boring JSON format… I got you, if you run the following command 

./kollect --browser

This is going to open your browser and display a lovely version of your inventory of your Kubernetes cluster as below, this however if you have downloaded the binary you might get a dreaded 404 page not found, although /api/data should return some details. 

If you have git cloned then your browser will look like this 

You will also see a fancy export data button which allows you to download the inventory. 

I will try and fix the github actions and work out why the web contents is not being packaged with the automated go build. 

I almost forgot, sometimes maybe you only want to get the inventory focused on the storage related objects within your cluster, you can run the following to get a breakdown of this. 

./kollect --storage

AWS Inventory 

But Michael… I hear you cry… I do not have Kubernetes… but you do have AWS and would like an inventory based on the AWS SDK or CLI access you have? 

If you issue the following command on a system where you have the above CLI or SDK configured to your AWS account then you will get a return on your resources. 

./kollect --inventory aws 

and again if you want to see this lovely inventory in a browser you can run that with 

./kollect --inventory aws --browser

Thats it for now but I have some ideas and work to do. 

Futures

  • Fix GitHub Actions to include web resources for browser functionality
  • Add Microsoft Azure Resources 
  • Add Google Cloud Platform Resources 
  • Make UI prettier 
  • Explore other platforms to inventory 

What else should we capture and inventory? 

How can you help?

If you can, it would be great to see how things work for you? I have tried to be open on things that are broken above but any other feedback is welcome. 

 

Its important to me that this tool is not asking for any credentials, it will use existing configuration for Kubernetes and cloud based authentication already configured on the machine. Initially I had built only a browser functionality but then when on a CLI only server realised that we needed that as a default. 

 

 

 

This is definitely an interesting project and will take it for a spin.  Thanks for putting this one together Michael.


Very nice! 

 


I have added Microsoft Azure inventory, I only have Storage accounts and blob containers would love for someone to test with some more in their account. 

 


I made some more progress on this little project. 

We added more Azure resources to the inventory. 

With the AWS side we were only gathering resources within the same region as the SDK was configured for, so we modified the inventory.go to go through all regions. This was not an issue for S3 buckets. 

 

The tool didn’t work on WSL (Windows Subsystem for Linux) with the browser flag so now it will still serve a browser allowing the user to open a browser on the host windows machine and see the contents of the inventory. 
 

We have some other ideas to keep this learning project going. 
 

Capture CRDs (Custom Resource Definitions) within the Kubernetes cluster, this will help discover potential operators that have been deployed in cluster. 
 

Import function, we have the ability to export to JSON @AndreAtkinson suggested a way to import this to visually represent in the browser. 
 

Testing, it would be good to either have the above for testing or to actually be able to provision these resources to confirm we have them available and reported on within the inventory. 
 

Specifically for K8s it would be good to understand the data services in use, how could we flag a Postgres, MySQL, MongoDB, etc based on PVC? Is naming enough? 
 

The other audacious idea is to somehow show some cost analysis against these resources. But will see how we go with everything else first. 
 

Would love to hear your experience on this and if you have more resources in your AWS or Azure account then please share some screenshots. 

Updated video session here  

 

 

 

 


Comment