<p>I am trying to configure kubernetes plugin in Jenkins. Here are the details I am putting in:</p>

<p><a href="https://i.stack.imgur.com/OuRnk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OuRnk.png" alt="enter image description here"></a></p>

<p>Now, when I click on test connection, I get the following error:</p>

<pre><code>Error testing connection https://xx.xx.xx.xx:8001: Failure executing: GET at: https://xx.xx.xx.xx:8001/api/v1/namespaces/default/pods. Message: Unauthorized! Configured service account doesn't have access. Service account may have been revoked. Unauthorized.
</code></pre>

<p>After doing some google, I realized it might be because of role binding, so I create a role binding for my <code>default</code> service account:</p>

<pre><code># kubectl describe rolebinding jenkins
Name:         jenkins
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;
Role:
  Kind:  ClusterRole
  Name:  pod-reader
Subjects:
  Kind            Name     Namespace
  ----            ----     ---------
  ServiceAccount  default  default
</code></pre>

<p>Here is the pod-reader role:</p>

<pre><code># kubectl describe role pod-reader
Name:         pod-reader
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;
PolicyRule:
  Resources  Non-Resource URLs  Resource Names  Verbs
  ---------  -----------------  --------------  -----
  pods       []                 []              [get watch list]
</code></pre>

<p>But I still get the same error. Is there anything else that needs to be done here? TIA.</p>

Pensu
<p>I think it's not working because you didn't provide the certificate. <a href="https://stackoverflow.com/a/46445351/9413576">This</a> worked for me.</p>
