I have https://containers.cloud.ibm.com/global/swagger-global-api - Kubernetes API swagger to drill upto each clusters details till namespaces.Using IAM token to access these API’s. Further, i want to get all the pods of that specific namespace and in turn image version of each pod.
I have tried using https://github.com/kubernetes-client/javascript client libraries to fetch all pods,But how will i get the pods of namespaces from my cluster of my account programatically?
This i want to achieve either by using REST API's or some client libraries.How to use these libraries?
var k8s = require('@kubernetes/client-node');
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const k8sApi = kc.makeApiClient(k8s.CoreV1Api);
const listFn = () => k8sApi.listPodForAllNamespaces()
console.log(listFn);
I get nothing from the above code.