Welcome to the Linux Foundation Forum!

Lab 12.3 Cannot make metrics-server work.

I used the step 1 to download the package. The step 2 did not work, because the package changed. I used the way I got from the web site to install metrics-server:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
When I taped the "[email protected]:~$ kubectl top node", I got " error: metrics not available yet".
I checked and found "metrics-server-5f956b6d5f-2lbzv 1/1 Running 0 3m58s".
I deleted the deployment. svc, and sa of the "metrics-serve", and used:
sudo kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
did it again. I got the same error.
What should I do to fix this problem?

Thanks,

Wei

Comments

  • chrispokornichrispokorni Posts: 549

    Hi Wei,

    Typically, the metrics-server needs a good few minutes to start collecting metrics from your cluster. If you issue the kubectl top command too soon, you will see the metrics not available yet message.

    Regards,
    -Chris

  • zhangwezhangwe Posts: 39

    Hi Chris,

    Thank you very much for your response.
    But it still did not work.

    Wei

  • serewiczserewicz Posts: 652

    Hello,

    I have just run the lab and it worked. Here is what I did:
    git clone https://github.com/kubernetes-incubator/metrics-server.git
    less README.md
    kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml
    kubectl -n kube-system edit deployments.apps metrics-server

    ....
    - --cert-dir=/tmp
    - --secure-port=4443
    - --kubelet-insecure-tls #<<---------------Added this insecure TLS line
    image: k8s.gcr.io/metrics-server/metrics-server:v0.3.7
    ....
    sleep 120 ; kubectl -n kube-system top pod
    NAME CPU(cores) MEMORY(bytes)
    calico-kube-controllers-578894d4cd-48hrz 1m 6Mi
    calico-node-cx7gb 25m 25Mi
    calico-node-hxfwn 30m 24Mi
    coredns-66bff467f8-rqhvr 3m 6Mi
    coredns-66bff467f8-sbnn4 3m 6Mi
    etcd-master 19m 42Mi
    ....

    It works.

    Regards,

  • zhangwezhangwe Posts: 39

    It works. Thank you very much for your help.

  • serewiczserewicz Posts: 652

    Great! I've added it to the update and it should be part of the 1.19 release.

Sign In or Register to comment.