<p>I am trying to use the kubernetes extension in vscode.
However, when I try to click on any item in the menu list (see image), I receive the error popup <code>Unable to connect to the server: Forbidden</code>.</p>
<p><a href="https://i.stack.imgur.com/1JaDO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1JaDO.png" alt="image" /></a></p>
<p>The kubernetes debug logs are however completely empty, and the kubectl CLI also seems to work fine. For example the command <code>kubectl config get-contexts</code> returns:</p>
<pre><code>CURRENT   NAME                         CLUSTER                      AUTHINFO        NAMESPACE
          ....
 *        ftxt-gpus-dev.oa             ftxt-gpus-dev.oa             username        my-namespace
</code></pre>
<p>When I run <code>kubectl auth can-i --list</code> I get the following:</p>
<pre><code>Resources                                       Non-Resource URLs   Resource Names   Verbs
pods/exec                                       []                  []               [*]
pods/portforward                                []                  []               [*]
pods/status                                     []                  []               [*]
pods                                            []                  []               [*]
secrets                                         []                  []               [*]
cronjobs.batch                                  []                  []               [*]
jobs.batch                                      []                  []               [*]
selfsubjectaccessreviews.authorization.k8s.io   []                  []               [create]
selfsubjectrulesreviews.authorization.k8s.io    []                  []               [create]
events                                          []                  []               [get list watch]
namespaces/status                               []                  []               [get list watch]
namespaces                                      []                  []               [get list watch]
nodes/status                                    []                  []               [get list watch]
nodes                                           []                  []               [get list watch]
                                                [/api/*]            []               [get]
                                                [/api]              []               [get]
                                                [/apis/*]           []               [get]
                                                [/apis]             []               [get]
                                                [/healthz]          []               [get]
                                                [/healthz]          []               [get]
                                                [/livez]            []               [get]
                                                [/livez]            []               [get]
                                                [/openapi/*]        []               [get]
                                                [/openapi]          []               [get]
                                                [/readyz]           []               [get]
                                                [/readyz]           []               [get]
                                                [/version/]         []               [get]
                                                [/version/]         []               [get]
                                                [/version]          []               [get]
                                                [/version]          []               [get]
</code></pre>

Ford O.
<p>This error means that the correct Role-Based Access Control (RBAC) permissions or the correct authorization policy are not set. To fix this error, you should first check the RBAC permissions for the user account you are attempting to use. You can do this by running the command <code>kubectl get clusterrolebinding</code> to view the current RBAC permissions. If you don’t have a role binding try to create one using <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">Kubernetes RBAC</a>.</p>
<p>Also you should check the authorization policy for the cluster. This can be done by running the command <code>kubectl get authorizationpolicies</code>. If the authorization policy is set to deny access to all users, then you should update the policy to allow the user to access the cluster.</p>
