govc object.collect – An essential tool for govmomi developers

A while back, I was looking at ways that I could query vSphere resources and inventory using the Go language. My end goal was to develop a prototype Kubernetes Operator to extend Kubernetes so that a developer or K8s cluster admin could query vSphere resources and inventory from the kubectl interface. While the Go language itself has lots of code examples online, and is relatively intuitive to a novice programmer like myself, I struggled quite a bit with getting to grips with govmomi, the Go library for interacting with the VMware vSphere API. In particular, I had difficultly in trying…

Using a Kubernetes Operator to query vSphere Resources

As many regular readers will be aware, I’ve spent a bit of time in the past looking at how vSphere resources are consumed by Kubernetes objects, when Kubernetes is deployed as a set of virtual machines on top of vSphere infrastructure. While much of this is visible in the vSphere client, I’m focused on how to see this vSphere resource consumption from within Kubernetes. If I am working in Kubernetes, I’d rather not context switch out to the vSphere client just to see how much storage is left on a datastore or how much CPU and Memory is left on…