<p>My private AKS Cluster is accessible only to the root user using <code>kubectl</code> on a jumphost. But for a non-root user it throws below error message:</p>
<pre class="lang-bash prettyprint-override"><code>someuser@jump-vm$ kubectl get pods -A
Error from server (Forbidden): pods is forbidden: User &quot;XX-XX-XX-XX-XX&quot; cannot list resource &quot;XX&quot; in API group &quot; &quot; at the cluster scope
</code></pre>
<p>How to resolve this error?</p>

Rajesh Swarnkar
<p>It seems the Azure VM from the private AKS cluster was being accessed was set to automatic restart which caused some issue with <code>kubectl</code> or <code>kubelogin</code>.</p>
<p>I followed below steps for both -- root as well as non-root user and after <code>kubectl</code> worked successfully.</p>
<pre class="lang-bash prettyprint-override"><code>root@jump-vm# cd ~ &amp;&amp; cd .kube/
root@jump-vm# rm -r cache &amp;&amp; rm config 
root@jump-vm# az login --tenant &lt;tenant-id&gt;
root@jump-vm# az account set --subscription &lt;subscription-id&gt;
root@jump-vm# az aks get-credentials --resource-group &lt;resource-group-name&gt; --name &lt;aks-clutser-name&gt;
root@jump-vm# kubelogin convert-kubeconfig -l azurecli

someuser@jump-vm$ cd ~ &amp;&amp; cd .kube/
someuser@jump-vm$ rm -r cache &amp;&amp; rm config 
someuser@jump-vm$ az login --tenant &lt;tenant-id&gt;
someuser@jump-vm$ az account set --subscription &lt;subscription-id&gt;
someuser@jump-vm$ az aks get-credentials --resource-group &lt;resource-group-name&gt; --name &lt;aks-clutser-name&gt;
someuser@jump-vm$ kubelogin convert-kubeconfig -l azurecli
</code></pre>
