본문으로 건너뛰기

metrics-server

metrics server

https://ssup2.github.io/theory_analysis/Kubernetes_Metric_Server/

설치

helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm repo update metrics-server \
&& helm search repo metrics-server/metrics-server -l | head -n 10
helm pull metrics-server/metrics-server --version 3.12.2
helm show values metrics-server-3.12.2.tgz \
> metrics-server-3.12.2.yaml
metrics-server-values.yaml
commonLabels: {}

args:
[]
# - --kubelet-insecure-tls
# - --v=2

resources:
requests:
cpu: 100m
memory: 200Mi

tolerations:
- operator: Exists
정보

로그에 "Failed to scrape node" err="Get \"https://xxx:10250/stats/summary?only_cpu_and_memory=true\": x509: cannot validate certificate for xxx because it doesn't contain any IP SANs" node="xxx"와 같은 에러가 발생하는 경우 --kubelet-insecure-tls를 추가해주세요.

helm template metrics-server metrics-server-3.12.2.tgz \
-n kube-system \
-f metrics-server-values.yaml \
> metrics-server.yaml
helm upgrade metrics-server metrics-server-3.12.2.tgz \
--install \
--history-max 5 \
-n kube-system \
-f metrics-server-values.yaml

삭제

helm uninstall metrics-server -n kube-system

Troubleshooting

kubectl describe apiservices v1beta1.metrics.k8s.io