title: Listing pods from inside a pod Forbidden
body: <p>I'm new to kubernetes. I'm trying to list all the pods in a namespace from inside a pod/container via the javascript client.  </p>
  
  <pre><code>import k8s = require('@kubernetes/client-node');
  
  const kc = new k8s.KubeConfig();
  kc.loadFromDefault();
  
  const k8sApi = kc.makeApiClient(k8s.Core_v1Api);
  
  k8sApi.listNamespacedPod('development')
      .then((res) =&gt; {
          console.log(res.body);
      }).catch((err) =&gt; {
          console.log(err);
      });
  </code></pre>
  
  <p>The response error when I look at my pod logs:</p>
  
  <pre><code>{ kind: 'Status',
   apiVersion: 'v1',
   metadata: {},
   status: 'Failure',
   message:
    'pods is forbidden: User "system:serviceaccount:default:default" cannot list pods in the namespace "development"',
   reason: 'Forbidden',
   details: { kind: 'pods' },
   code: 403 } } 
  </code></pre>
  
  <p>I believe I need to create a new User or add some permissions to a Role but I'm not sure where and how. Thanks</p>