title: jobs.batch is forbidden: User ' '"system:serviceaccount:default:default" cannot list resource "jobs" in API group "batch" in the namespace "default"
body: <p>I am using <a href="https://github.com/kubernetes-client/javascript" rel="nofollow noreferrer">Kubernetes javascript client</a> with, <strong>in-cluster configurations</strong> to interact with the cluster.</p>
  <p>I am trying to get the list of jobs</p>
  <p>app.js(Node)</p>
  <pre><code>app.get(&quot;/&quot;, (req, res) =&gt; {
    k8sApi2
      .listNamespacedJob(&quot;default&quot;)
      .then((res) =&gt; {
        console.log(res.body);
        res.send(res.body);
      })
      .catch((err) =&gt; console.log(err));
  });
  </code></pre>
  <p>But this is the log of the pod I am getting.</p>
  <p><a href="https://i.stack.imgur.com/zwJQf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zwJQf.png" alt="Log" /></a></p>
  <p>Here are my deployment</p>
  <p><a href="https://i.stack.imgur.com/9B1E0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9B1E0.png" alt="Deployment" /></a></p>
  <p>Service</p>
  <p><a href="https://i.stack.imgur.com/vfIQc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vfIQc.png" alt="Service" /></a></p>
  <p>Also, I created a role and a role binding but still, I have no idea what makes this issue.</p>
  <pre><code>---
  apiVersion: v1
  kind: ServiceAccount
  metadata:
    name: node-apis
  ---
  kind: Role
  apiVersion: rbac.authorization.k8s.io/v1
  metadata:
    name: node-apis
  rules:
    - apiGroups:
        - &quot;&quot;
        - &quot;apps&quot;
        - &quot;batch&quot;
      resources:
        - endpoints
        - deployments
        - pods
        - jobs
      verbs:
        - get
        - list
        - watch
        - create
        - delete
  ---
  kind: RoleBinding
  apiVersion: rbac.authorization.k8s.io/v1
  metadata:
    name: node-apis
    namespace: default
  subjects:
    - kind: ServiceAccount
      name: node-apis
      namespace: default
  roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: Role
    name: node-apis
  
  </code></pre>
  <p>I am new to Kubernetes, any help?</p>