|NO.Z.00062|——————————|^^ 部署 ^^|——|KuberNetes&二進位制部署.V15|3臺Server|---------------------------------------|kubernetes元件|metrics-server|
阿新 • • 發佈:2022-03-29
[CloudNative:KuberNetes&二進位制部署.V15] [Applications.KuberNetes] [|DevOps|k8s|**3節點**|二進位制1.20|kubernetes元件|metrics-server|]
一、部署Metrics Server
### --- metrics server概述 ~~~ 在新版的Kubernetes中系統資源的採集均使用Metrics-server, ~~~ 可以通過Metrics採集節點和Pod的記憶體、磁碟、CPU和網路的使用率。
### --- 部署metrics server
~~~ 切換到metrics-server安裝目錄下
[root@k8s-master01 ~]# cd /root/k8s-ha-install/metrics-server-0.4.x/
二、檢視服務狀態### --- 部署metrics-server [root@k8s-master01 metrics-server-0.4.x]# kubectl create -f . ~~~ 注:輸出結果 serviceaccount/metrics-server created clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created clusterrole.rbac.authorization.k8s.io/system:metrics-server created rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created service/metrics-server created deployment.apps/metrics-server created apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
### --- 等待metrics server啟動然後檢視狀態
~~~ 檢視metrics-server.pod狀態
[root@k8s-master01 metrics-server-0.4.x]# kubectl get po -n kube-system
NAME READY STATUS RESTARTS AGE
metrics-server-595f65d8d5-l6f7k 1/1 Running 0 69s
### --- 檢視metrics-server監控到pod資源的狀態 ~~~ 檢視metrics監控狀態 [root@k8s-master01 metrics-server-0.4.x]# kubectl top node NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% k8s-master01 246m 12% 1622Mi 42% k8s-node01 171m 8% 712Mi 18% k8s-node02 277m 13% 657Mi 22%
===============================END===============================
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor
來自為知筆記(Wiz)