What's the proper way to query the prometheus kubelet metrics API using Java, specifically the PVC usage metrics? I can see there's an API to fetch some metrics via the auto-scaler, but my cluster doesn't have an auto-scaler, so this returns an empty list:
AutoscalingV2beta2Api autoscalingV2beta2Api = new AutoscalingV2beta2Api(apiClient);
var autoscalers = autoscalingV2beta2Api
.listHorizontalPodAutoscalerForAllNamespaces(null, null, null, null, null, null, null, null, null)
.getItems();
For reference, I think this is what I need to fetch: https://stackoverflow.com/a/56870054/18437
I'm not keen on using the kubectl -n <namespace> exec <pod-name> df
method because then I'll need to make the pod volume mounts back to the volume claims list I've already fetched via the K8s API.
Thanks!