<p>I have installed the Upbound CLI locally and since then I (I think) am <code>receiving Error from server (Forbidden)</code> error message when I try to execute different commands using <code>kubectl</code>:</p>
<p><code>kubectl get secrets</code></p>
<pre><code>Error from server (Forbidden): secrets is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;secrets&quot; in API group &quot;&quot; in the namespace &quot;default&quot;
</code></pre>
<p><code>kubectl get all</code></p>
<pre><code>Error from server (Forbidden): replicationcontrollers is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;replicationcontrollers&quot; in API group &quot;&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): services is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;services&quot; in API group &quot;&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): daemonsets.apps is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;daemonsets&quot; in API group &quot;apps&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): deployments.apps is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;deployments&quot; in API group &quot;apps&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): replicasets.apps is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;replicasets&quot; in API group &quot;apps&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): statefulsets.apps is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;statefulsets&quot; in API group &quot;apps&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): horizontalpodautoscalers.autoscaling is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;horizontalpodautoscalers&quot; in API group &quot;autoscaling&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): cronjobs.batch is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;cronjobs&quot; in API group &quot;batch&quot; in the namespace &quot;default&quot;
Error from server (Forbidden): jobs.batch is forbidden: User &quot;upbound-cloud-impersonator&quot; cannot list resource &quot;jobs&quot; in API group &quot;batch&quot; in the namespace &quot;default&quot;
</code></pre>
<p>It seems that the user has been changed to &quot;upbound-cloud-impersonator&quot;, but I am not sure why and how to switch it back to what it was before.</p>
<p>If it helps, these are the namespaces:</p>
<pre><code>crossplane-system   Active   2d21h
default             Active   2d21h
kube-node-lease     Active   2d21h
kube-public         Active   2d21h
kube-system         Active   2d21h
upbound-system      Active   2d21h
velero              Active   2d21h
</code></pre>
<p>And the list of users <code>kubectl config view -o jsonpath='{.users[*].name}'</code>:<br />
<code>minikube upbound-3f93ea79-ba0e-4fdc-ae69-f2c562279579</code></p>

Valip
<ul>
<li>The user <code>upbound-cloud-impersonator</code> is not having enough RBAC permissions to get the secrets.  The alternative solution is to set setup enough RBAC permission.</li>
</ul>
<p>You can validate this using the below command:</p>
<pre><code>kubectl auth can-i get secret --as upbound-cloud-impersonator
</code></pre>
<p>Or just run(as your context is already changed):</p>
<pre><code>kubectl auth can-i get secret
</code></pre>
<ul>
<li><p>Your current context is switched to something else. The new context is using <code>upbound-cloud-impersonator</code>. you may run the following command to list your current context</p>
<p>kubectl config current-context</p>
</li>
</ul>
<p><a href="https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_config_use-context/" rel="noreferrer">To switch to another context</a>, you may first run the following command to list your context list. Notice the <code>*</code> sign that signifies the current context. <em>Note that the context name used here are examples and may differ for your cluster.</em></p>
<pre><code>kubectl config get-contexts
CURRENT   NAME                                 CLUSTER   AUTHINFO                     NAMESPACE
          default                              default   default
*         upbound-cloud-impersonator@default   default   upbound-cloud-impersonator
</code></pre>
<p>To switch to the other context, will change the current context to the provided one. Use appropriate context to switch.</p>
<pre><code> kubectl config use-context default
</code></pre>
<p>Notice the <code>*</code> sign:</p>
<pre><code>kubectl config get-contexts
CURRENT   NAME                                 CLUSTER   AUTHINFO                     NAMESPACE
*         default                              default   default
          upbound-cloud-impersonator@default   default   upbound-cloud-impersonator
</code></pre>
<p>Validate the authorization:</p>
<pre><code>kubectl auth can-i get secret
yes
</code></pre>
