<p>While trying to deploy an application got an error as below:</p>
<pre><code>Error: UPGRADE FAILED: could not get apiVersions from Kubernetes: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
</code></pre>
<p>Output of <strong><code>kubectl api-resources</code></strong> consists some resources along with the same error in the end.</p>
<p><strong>Environment</strong>: Azure Cloud, AKS Service</p>

Sanket Singh
<p>Solution:</p>

<p>The steps I followed are:</p>

<ol>
<li><p><code>kubectl get apiservices</code> : If metric-server service is down with the error <strong>CrashLoopBackOff</strong> try to follow the step 2 otherwise just try to restart the metric-server service using <strong>kubectl delete apiservice/"service_name"</strong>. For me it was <strong>v1beta1.metrics.k8s.io</strong> .</p></li>
<li><p><code>kubectl get pods -n kube-system</code> and found out that pods like metrics-server, kubernetes-dashboard are down because of the main coreDNS pod was down.</p></li>
</ol>

<hr>

<p>For me it was: </p>

<pre><code>NAME                          READY   STATUS             RESTARTS   AGE
pod/coredns-85577b65b-zj2x2   0/1     CrashLoopBackOff   7          13m
</code></pre>

<ol start="3">
<li>Use <code>kubectl describe pod/"pod_name"</code> to check the error in coreDNS pod and if it is down because of <strong>/etc/coredns/Corefile:10 - Error during parsing: Unknown directive proxy</strong>, then we need to use <strong>forward</strong> instead of <strong>proxy</strong> in the yaml file where coreDNS config is there. Because CoreDNS version 1.5x used by the image does not support the <strong>proxy</strong> keyword anymore.</li>
</ol>
