<p>My pod metrics stopped working on a local <code>minikube</code> deployment. It appears similar to an <a href="https://github.com/kubernetes/kubernetes/issues/94281" rel="nofollow noreferrer">issue reported a while back</a>, but I don't see the same error messages in the logs. The node statistics are working fine:</p>
<pre><code>% kubectl top node                                           
NAME       CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
minikube   245m         6%     3199Mi          40%   
</code></pre>
<p>However, the pod statistics result in an error:</p>
<pre><code>% kubectl top pod                                            
W0506 11:12:00.129992   50236 top_pod.go:265] Metrics not available for pod default/node-5bbfbdd47-24z4c, age: 19h15m52.129979s
error: Metrics not available for pod default/node-5bbfbdd47-24z4c, age: 19h15m52.129979s

</code></pre>
<p>There are no errors on the logs:</p>
<pre><code>% kubectl logs -n kube-system metrics-server-6b76bd68b6-bb2mn
I0506 09:07:22.734381       1 serving.go:325] Generated self-signed cert (/tmp/apiserver.crt, /tmp/apiserver.key)
I0506 09:07:23.544196       1 requestheader_controller.go:169] Starting RequestHeaderAuthRequestController
I0506 09:07:23.544214       1 shared_informer.go:240] Waiting for caches to sync for RequestHeaderAuthRequestController
I0506 09:07:23.544267       1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0506 09:07:23.544273       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0506 09:07:23.544284       1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0506 09:07:23.544287       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0506 09:07:23.549006       1 secure_serving.go:197] Serving securely on [::]:4443
I0506 09:07:23.549351       1 dynamic_serving_content.go:130] Starting serving-cert::/tmp/apiserver.crt::/tmp/apiserver.key
I0506 09:07:23.549577       1 tlsconfig.go:240] Starting DynamicServingCertificateController
I0506 09:07:23.644335       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file 
I0506 09:07:23.644361       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file 
I0506 09:07:23.644374       1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController 
</code></pre>
<p>Inspecting minkube stats I do not see the pods listed.</p>
<pre><code>% kubectl get --raw /api/v1/nodes/minikube/proxy/stats/summary
{
 &quot;node&quot;: {
  &quot;nodeName&quot;: &quot;minikube&quot;,
  &quot;systemContainers&quot;: [
   {
    &quot;name&quot;: &quot;kubelet&quot;,
# SOME OUTPUT REMOVED
 },
 &quot;pods&quot;: []
}%  

</code></pre>
<p>How do I get pod metrics working on minikube?</p>
<p>Environment:</p>
<ul>
<li>Intel Mac - Darwin Kernel Version 21.4.0</li>
<li>Docker version 20.10.10, build b485636</li>
<li>minikube version: v1.25.2 (driver=docker, 2cpu/6g/200g)</li>
<li>kubectl client v1.20.10</li>
<li>kubectl server v1.23.3</li>
</ul>

<p>Either switching to <code>hyperkit</code> or making sure that there are enough resources available resolved the issue. Perhaps <code>metrics-server</code>, same as the <code>ingress-dns</code> only works reliably with the <code>hyperkit</code> driver or requires a certain amount of available resources. Below are steps to resolve my problem. Note that my minikube settings had to be wiped for this to work:</p>
<pre><code>% brew install hyperkit
% minikube delete
% minikube start --driver=hyperkit --memory 8192 --cpus 6 --disk-size 200g

</code></pre>
