新聞中心
這篇文章主要講解了“kubectl top插件的安裝方法”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“kubectl top插件的安裝方法”吧!
創(chuàng)新互聯(lián)云計算的互聯(lián)網(wǎng)服務(wù)提供商,擁有超過13年的服務(wù)器租用、服務(wù)器機柜租用、云服務(wù)器、網(wǎng)站空間、網(wǎng)站系統(tǒng)開發(fā)經(jīng)驗,已先后獲得國家工業(yè)和信息化部頒發(fā)的互聯(lián)網(wǎng)數(shù)據(jù)中心業(yè)務(wù)許可證。專業(yè)提供云主機、網(wǎng)站空間、主機域名、VPS主機、云服務(wù)器、香港云服務(wù)器、免備案服務(wù)器等。
1.下載yaml 文件
wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/auth-delegator.yaml wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/metrics-server-service.yaml wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/auth-reader.yaml wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/metrics-apiservice.yaml wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/metrics-server-deployment.yaml wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/aggregated-metrics-reader.yaml wget http://pencil-file.oss-cn-hangzhou.aliyuncs.com/blog/resource-reader.yaml
2. 修改metrics-server-deployment.yaml文件
核心配置:
containers: - name: metrics-server image: k8s.gcr.io/metrics-server-amd64:v0.3.2 imagePullPolicy: IfNotPresent #修改為本地有鏡像優(yōu)先使用 command: - /metrics-server - --metric-resolution=30s - --kubelet-insecure-tls - --kubelet-preferred-address-types=InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP #容器的預(yù)設(shè)值 腳本 volumeMounts: - name: tmp-dir mountPath: /tmp
3.拉取鏡像
docker pull k8s.gcr.io/metrics-server-amd64
由于該鏡像在國外所以可能使用其他途徑 代理上網(wǎng)或者本地導(dǎo)入
代理上網(wǎng)法
mkdir -p /etc/systemd/system/docker.service.d #創(chuàng)建放代理的文件夾,默認(rèn)沒有 echo '[Service] Environment="HTTP_PROXY=192.168.0.26:8118" "HTTPS_PROXY=192.168.0.26:8118"' >/etc/systemd/system/docker.service.d/http-proxy.conf #創(chuàng)建代理的配置件,前提得有能訪問到國外鏡像服務(wù)器的代理服務(wù)器 systemctl daemon-reload systemctl restart docker #重啟docker
以上腳本運行一下 就能pull 到國外鏡像了
本地導(dǎo)出導(dǎo)入法 4.應(yīng)用 感謝各位的閱讀,以上就是“kubectl top插件的安裝方法”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對kubectl top插件的安裝方法這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
先到拉取完畢的主機上導(dǎo)出
docker save -o metrics-server-amd64:v0.3.2.tar k8s.gcr.io/metrics-server-amd64:v0.3.2
#.tar 為完成的打包文件,后面的是需要導(dǎo)出的鏡像名需要帶版本名,鏡像名用docker images 查看
導(dǎo)入
docker load
kubectl apply -f ./
#應(yīng)用下載的所有yaml文件
kubectl get pod -n kube-system
#查看一下pod 是否正常
分享標(biāo)題:kubectltop插件的安裝方法
URL網(wǎng)址:http://fisionsoft.com.cn/article/ppiich.html