I wrote a device plugin to manage a collection of SRIOV devices. When a new pod deployment (e.g., kubectl create ...) request is made, the request includes a resource count for the number of VFs. The k8s scheduler figures out the node with enough devices, and eventually the pod is deployed. THat all works as expected.
But the device plugin also knows each VF's usage stats, e.g., the amount of requests each VF has been charged with, per second.
I'd like to know the "k8s way" to present these stats so that they can be available to someone who wants to know, for example, which VF has the most requests per second, etc.
Like I said, I've already got the stats... I just want to know the best/simplest mechanism that k8s prefers, and that an admin using something like kubectl on the cluster master can look at and see how much a particular pod is driving its vf(s).
I created a service on the pod that holds the device plugin on the node, and I can query it to get usage stats on all SRIOV VFs. But that's pretty insecure if I grant access to all pods: any pod can see what any other VF using pod is up to, and that is not a good idea.
A shared memory segment could also be cgroup'd, but that seems a bit like reinventing the wheel to make it robust, and though I could do it, I'm trying to find the path the k8s world prefers.
I would anticipate running something like kubectl to ask about pod status, and I'd (magically) see the assigne VF stats for the tenant pod that owns and uses one to many VFs.