title: How to get all running PODs on Kubernetes cluster
body: <p>This simple Node.js program works fine on local because it pulls the kubernetes config from my local /root/.kube/config file</p>
  
  <pre><code>const Client = require('kubernetes-client').Client;
  const Config = require('kubernetes-client/backends/request').config;
  
  const client = new K8sClient({ config: Config.fromKubeconfig(), version: '1.13' });
  
  const pods = await client.api.v1.namespaces('xxxxx').pods.get({ qs: { labelSelector: 'application=test' } });
  console.log('Pods: ', JSON.stringify(pods));
  </code></pre>
  
  <p>Now I want to run it as a Docker container on cluster and get all current cluster's running PODs (for same/current namespace). Now of course it fails:</p>
  
  <pre><code>Error:  { Error: ENOENT: no such file or directory, open '/root/.kube/config'
  </code></pre>
  
  <p>So how make it work when deployed as a Docker container to cluster?
  This little service needs to scan all running PODs... Assume it doesn't need pull config data since it's already deployed.. So it needs to access PODs on current cluster</p>