<p>When sending request to api, it throws NPE at api.listPodForAllNamespaces step. Could you please advise, what should be the correct configuration here?</p>

vehk
<p>As the error says:</p>
<p><code>pods is forbidden: User \&quot;system:serviceaccount:sds-test:default\&quot; cannot list resource \&quot;pods\&quot;</code></p>
<p>This means that the service account <code>default</code> in the namespace <code>sds-test</code> does not have the appropriate permissions to list pods. You are probably not specifying a service account when you deploy. K8s will automatically assign you the <code>default</code> service account.</p>
<p>You need to create a <code>ServiceAccount</code>. Grant it the required access using a <code>Role</code> and <code>RoleBinding</code>. Then update your <code>Deployment</code>/<code>Pod</code> to use your newly created <code>ServiceAccount</code>. Details of which can be found <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">here</a></p>
