TIL

helm chart로 prometheus 및 노드/파드 메트릭 쉽게 수집 하는법.

하얀잔디 2026. 2. 19. 16:06

전제

  • k8s 클러스터 접근 가능해야 함 (kubectl 됨)
  • Helm 설치돼 있어야 함 (helm 됨)
  • (k3s면) kubeconfig 잡혀 있어야 함

확인부터 하자.

 

kubectl version --short
kubectl cluster-info
helm version

 

 

2) Helm repo 추가/업데이트

kube-prometheus-stack 쓰는 게 제일 편했음. Prometheus/Alertmanager/Grafana/각종 exporter까지 세트로 깔림.

 
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

helm repo list
helm search repo prometheus-community/kube-prometheus-stack | head

 

 

 

3) 네임스페이스 만들기

모니터링은 monitoring으로 통일함.

 
kubectl create namespace monitoring
kubectl get ns | grep monitoring

 

 

4) Prometheus만 켜고  + NodePort 30900으로 노출


cat > values-prom.yaml <<'EOF'
grafana:
  enabled: false

prometheus:
  service:
    type: NodePort
    nodePort: 30900

alertmanager:
  enabled: false
EOF

 

5) 설치

 

helm install mon prometheus-community/kube-prometheus-stack \
  -n monitoring -f values-prom.yaml

 


6) 확인


kubectl -n monitoring get pods -o wide
kubectl -n monitoring get svc | egrep -i 'prometheus|nodeport|30900'