Metricserver

Notes

https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.6.1/

  • 高可用 high-availability.yaml
  • 单机 component.yaml

apiserver

修改apiserver.yaml

vim /etc/kubernetes/manifests/kube-apiserver.yaml

spec:
  containers:
    - command:
      - kube-apiserver:
        ...
        - --enable-aggregator-routing=true
        ...

部署

kubectl apply -f /etc/kubernetes/manifests/kube-apiserver.yaml
# kube-apiserver              0/1     CrashLoopBackOff   5 (103s ago)     4m52s
# kube-apiserver-k8s          1/1     Running            0                5m59s
kubectl delete pod kube-apiserver -n kube-system --force --grace-period=0

metric-server

拉取镜像

crictl pull registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server:v0.6.1

下载meric-server.yaml文件

wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.6.1/components.yaml

# 修改yaml文件
---
    spec:
      containers:
      - args:
        ...
        - --kubelet-insecure-tls                                                         # [增]
        image: registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server:v0.6.1 # [改]

image

部署

kubectl apply -f components.yaml
kubectl get pod -n kube-system

验证

# metrics-server-8bf5d9dcb-lm99t             1/1     Running   0              24s
kubectl top pod
kubectl top pod -n kube-system
kubectl top node

image

posted @ 2022-10-16 10:05  608088  阅读(64)  评论(0编辑  收藏  举报