Ubuntu 24.04
Sponsored Link

MicroK8s : Enable Metrics Server2024/06/14

 

Enable Metrics Server add-on to monitor CPU and Memory resources in MicroK8s Cluster.

[1] Deploy Metrics Server on primary Node.
root@dlp:~#
microk8s enable metrics-server

Infer repository core for addon metrics-server
Addon core/metrics-server is already enabled

root@dlp:~#
microk8s kubectl get pods -n kube-system

NAME                                         READY   STATUS    RESTARTS      AGE
calico-kube-controllers-77bd7c5b-bcqzr       1/1     Running   2 (51m ago)   89m
calico-node-d6dl6                            1/1     Running   1 (51m ago)   57m
coredns-864597b5fd-jsvp6                     1/1     Running   2 (51m ago)   89m
dashboard-metrics-scraper-5657497c4c-qss9n   1/1     Running   0             46m
hostpath-provisioner-756cd956bc-244vm        1/1     Running   0             8m43s
kubernetes-dashboard-54b48fbf9-592zb         1/1     Running   0             46m
metrics-server-848968bdcd-mtklz              1/1     Running   0             46m
# [metrics-server] pod has been deployed
[2] To display CPU and Memory resources, run like follows.
root@dlp:~#
microk8s kubectl top node

NAME               CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
dlp.srv.world      110m         1%     1604Mi          10%
node01.srv.world   32m          0%     774Mi           4%

root@dlp:~#
microk8s kubectl top pod

NAME                         CPU(cores)   MEMORY(bytes)
nginx-nfs-6975cff5d6-jsrgp   0m           7Mi
nginx-nfs-6975cff5d6-n987f   0m           12Mi
nginx-nfs-6975cff5d6-w9mdk   0m           12Mi
Matched Content