<p>I am having test environment cluster with 1 master and two worker node, all the basic pods are up and running.</p>
<pre><code>root@master:~/pre-release# kubectl get pods -n kube-system
NAME                              READY   STATUS    RESTARTS   AGE
coredns-74ff55c5b-jn4pl           1/1     Running   0          23h
coredns-74ff55c5b-lz5pq           1/1     Running   0          23h
etcd-master                       1/1     Running   0          23h
kube-apiserver-master             1/1     Running   0          23h
kube-controller-manager-master    1/1     Running   0          23h
kube-flannel-ds-c7czv             1/1     Running   0          150m
kube-flannel-ds-kz74g             1/1     Running   0          150m
kube-flannel-ds-pb4f2             1/1     Running   0          150m
kube-proxy-dbmjn                  1/1     Running   0          23h
kube-proxy-kfrdd                  1/1     Running   0          23h
kube-proxy-wj4rk                  1/1     Running   0          23h
kube-scheduler-master             1/1     Running   0          23h
metrics-server-67fb68f54c-4hnt7   1/1     Running   0          9m

</code></pre>
<p>Next when i am checking pod logs for metric server i don't see any error message as well</p>
<pre><code>root@master:~/pre-release# kubectl -n kube-system logs -f metrics-server-67fb68f54c-4hnt7
I0330 09:53:15.286101       1 serving.go:325] Generated self-signed cert (/tmp/apiserver.crt, /tmp/apiserver.key)
I0330 09:53:15.767767       1 requestheader_controller.go:169] Starting RequestHeaderAuthRequestController
I0330 09:53:15.767790       1 shared_informer.go:240] Waiting for caches to sync for RequestHeaderAuthRequestController
I0330 09:53:15.767815       1 secure_serving.go:197] Serving securely on [::]:4443
I0330 09:53:15.767823       1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0330 09:53:15.767835       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0330 09:53:15.767857       1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0330 09:53:15.767865       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0330 09:53:15.767878       1 dynamic_serving_content.go:130] Starting serving-cert::/tmp/apiserver.crt::/tmp/apiserver.key
I0330 09:53:15.767897       1 tlsconfig.go:240] Starting DynamicServingCertificateController
I0330 09:53:15.867954       1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController
I0330 09:53:15.868014       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0330 09:53:15.868088       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
</code></pre>
<p>Then i verified metric services</p>
<pre><code>root@master:~/pre-release# kubectl describe apiservice v1beta1.metrics.k8s.io
Name:         v1beta1.metrics.k8s.io
Namespace:
Labels:       k8s-app=metrics-server
Annotations:  &lt;none&gt;
API Version:  apiregistration.k8s.io/v1
Kind:         APIService
Metadata:
  Creation Timestamp:  2021-03-30T09:53:13Z
  Resource Version:    126838
  UID:                 6da11b3f-87d5-4de4-92a0-463219b23301
Spec:
  Group:                     metrics.k8s.io
  Group Priority Minimum:    100
  Insecure Skip TLS Verify:  true
  Service:
    Name:            metrics-server
    Namespace:       kube-system
    Port:            443
  Version:           v1beta1
  Version Priority:  100
Status:
  Conditions:
    Last Transition Time:  2021-03-30T09:53:13Z
    Message:               failing or missing response from https://10.108.112.196:443/apis/metrics.k8s.io/v1beta1: Get &quot;https://10.108.112.196:443/apis/metrics.k8s.io/v1beta1&quot;: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    Reason:                FailedDiscoveryCheck
    Status:                False
    Type:                  Available
Events:                    &lt;none&gt;

</code></pre>
<p>finally status of type false and ending with above error.</p>
<p>Here the deployment spec file</p>
<pre><code> spec:
      containers:
      - args:
        - /metrics-server
        - --cert-dir=/tmp
        - --secure-port=4443
        - --kubelet-preferred-address-types=InternalIP
        - --kubelet-use-node-status-port
        - --kubelet-insecure-tls

</code></pre>
<p>kubectl top nodes</p>
<pre><code>root@master:~# kubectl top nodes
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
</code></pre>
<p>Now able to find thee solution still from yesterday, could you pleaes help me on this</p>

<p>In this case, adding <code>hostNetwork:true</code> under <code>spec.template.spec</code> to the <code>metrics-server</code> Deployment may help.</p>
<pre><code>...
 spec:
      hostNetwork: true
      containers:
      - args:
        - /metrics-server
        - --cert-dir=/tmp
        - --secure-port=4443
        - --kubelet-preferred-address-types=InternalIP
        - --kubelet-use-node-status-port
        - --kubelet-insecure-tls
...
</code></pre>
<p>As we can find in the <a href="https://kubernetes.io/docs/concepts/policy/pod-security-policy/#host-namespaces" rel="nofollow noreferrer">Kubernetes Host namespaces documentation</a>:</p>
<blockquote>
<p>HostNetwork - Controls whether the pod may use the node network namespace. Doing so gives the pod access to the loopback device, services listening on localhost, and could be used to snoop on network activity of other pods on the same node.</p>
</blockquote>
