<p>I have a working 1.15.1 kubenetes cluster using kubeadm on bare-metal and just deployed metrics-server as in the docs:</p>

<pre class="lang-sh prettyprint-override"><code>git clone https://github.com/kubernetes-incubator/metrics-server.git
kubectl create -f metrics-server/deploy/1.8+/
</code></pre>

<p>After some time I try <code>kubectl top node</code> and I get as response:</p>

<blockquote>
  <p>error: metrics not available yet</p>
</blockquote>

<p>Also when I try <code>kubectl top pods</code> I get:</p>

<blockquote>
  <p>W0721 20:01:31.786615 21232 top_pod.go:266] Metrics not available for
  pod default/pod-deployment-57b99df6b4-khh84, age: 27h31m59.78660593s
  error: Metrics not available for pod
  default/pod-deployment-57b99df6b4-khh84, age: 27h31m59.78660593s</p>
</blockquote>

<p>I checked the pod and service for metrics-server and all of them are running fine. Where should I try to see a problem?</p>

<p>Edit the metric-server deployment like Subramanian Manickam's answer said, you can also do it with </p>

<pre><code>$ kubectl edit deploy -n kube-system metrics-server
</code></pre>

<p>That will open a text editor with the deployment yaml-file where you can make the following changes:</p>

<p>Under <strong>spec.template.spec.containers</strong>, on the same level as <code>name: metrics-server</code> add </p>

<pre><code>args:
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --metric-resolution=30s
</code></pre>

<p>and then under <strong>spec.template.spec</strong> at the same level as <code>containers</code> I <strong>also had to add</strong>:</p>

<pre><code>hostNetwork: true
</code></pre>

<p>to fix the metrics-server working with the CNI (calico in my case).</p>

<p>Afterwards your deployment yaml should look something like this:</p>

<pre><code>[...]
spec:
  [...]
  template:
    metadata:
      creationTimestamp: null
      labels:
        k8s-app: metrics-server
      name: metrics-server
    spec:
      containers:
      - args:
        - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
        - --kubelet-insecure-tls
        - --metric-resolution=30s
        image: k8s.gcr.io/metrics-server-amd64:v0.3.3
        imagePullPolicy: Always
        name: metrics-server
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmp
          name: tmp-dir
      dnsPolicy: ClusterFirst
      hostNetwork: true
[...]
</code></pre>

<p>After that it took about 10-15s for <code>kubectl top pods</code> to return some data.</p>
