“安装Metrics server”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(创建页面,内容为“== <pre> 首先上官方选择下载你想要的版本 metri# grep -rn image components.yaml 140: image: k8s.gcr.io/metrics-server/metrics-server:v0.6.1 14…”)
 
 
第1行: 第1行:
==
+
=deployment=
 
<pre>
 
<pre>
 +
 +
#进阶  可安装ha版本
 +
 
首先上官方选择下载你想要的版本  
 
首先上官方选择下载你想要的版本  
  
第44行: 第47行:
 
work2    142m        3%    2048Mi          43%  
 
work2    142m        3%    2048Mi          43%  
 
</pre>
 
</pre>
==
+
=references=
 +
 
 +
https://zhuanlan.zhihu.com/p/523927494
 +
[[category:k8s]]

2023年10月18日 (三) 04:20的最新版本

deployment


#进阶  可安装ha版本 

首先上官方选择下载你想要的版本 

metri# grep -rn image components.yaml 
140:        image: k8s.gcr.io/metrics-server/metrics-server:v0.6.1
141:        imagePullPolicy: IfNotPresent
root@ubuntu-200470-1:~/metri# sed -i "s#k8s.gcr.io/metrics-server#registry.cn-hangzhou.aliyuncs.com/chenby#g" components.yaml
root@ubuntu-200470-1:~/metri# grep -rn image components.yaml 
140:        image: registry.cn-hangzhou.aliyuncs.com/chenby/metrics-server:v0.6.1
141:        imagePullPolicy: IfNotPresent
root@ubuntu-200470-1:~/metri# vi components.yaml 

添加"- --kubelet-insecure-tls"
​
例:
        args:
        - --cert-dir=/tmp
        - --secure-port=4443
        - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
        - --kubelet-use-node-status-port
        - --metric-resolution=15s
        - --kubelet-insecure-tls
        image: registry.cn-hangzhou.aliyuncs.com/chenby/metrics-server:v0.6.1
​

root@ubuntu-200470-1:~/metri# kubectl apply -f  components.yaml 
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
root@ubuntu-200470-1:~/metri# kubectl  get pod -n kube-system | grep metrics
metrics-server-845bcff787-q6zk9                 0/1     Running             0                 21s

root@ubuntu-200470-1:~/metri# kubectl  top nodes
NAME     CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
master   292m         7%     2212Mi          39%       
work1    127m         3%     1438Mi          30%       
work2    142m         3%     2048Mi          43% 

references

https://zhuanlan.zhihu.com/p/523927494