본문 바로가기

CKA &. CKAD/Logging & Monitoring

Monitoring Cluster Component

minikube

minikube addons enable metrics-server

 

others

git clone https://github.com/kubernetes-incubator/metrics-serve
kubectl create -f deploy/1.8+/

 

[View]

kubectl top node

kubectl top pod

 

[Practice Test]

 

ㅁ We have deployed a few PODs running workloads. Inspect it

kubectl get pod

ㅁ Let us deploy metrics-server to monitor the PODs and Nodes. Pull the git repository for the deployment files

git clone https://github.com/kodekloudhub/kubernetes-metrics-server.git

ㅁ Deploy the metric-server by creating all the domponents downloaded.

Run the 'kubectl create -f .' command from within the downloaded repository.

- Metrics server deployed?

controlplane $ cd kubernetes-metrics-server/
controlplane $ ls
aggregated-metrics-reader.yaml  metrics-apiservice.yaml         README.md
auth-delegator.yaml             metrics-server-deployment.yaml  resource-reader.yaml
auth-reader.yaml                metrics-server-service.yaml

controlplane $ kubectl create -f .
clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
serviceaccount/metrics-server created
deployment.apps/metrics-server created
service/metrics-server created
clusterrole.rbac.authorization.k8s.io/system:metrics-server created
clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created

ㅁ Identify the node that consumes the most CPU.

kubectl top node
NAME           CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
controlplane   118m         5%     1050Mi          55%       
node01         1999m        99%    580Mi           15%   

ㅁ Identify the node that consumes the most Memory

kubectl top node

ㅁ Identify the POD that consumes the most Memory

kubectl top pod

ㅁ Identify the POD that consumes the most CPU