Amazon EKS를 Prometheus와 Grafana로 모니터링하는 방법 (Helm 없이)
Source: Dev.to
Why Monitoring Is Important
- 클러스터 상태 확인
- 노드와 파드의 리소스 사용량 모니터링
- 문제를 조기에 발견
- 시스템 안정성 및 보안 향상
Tools Used
- Amazon EKS
- Prometheus
- Grafana
- kube-state-metrics
- node-exporter
Helm은 이 설정에서 사용되지 않습니다.
Simple Architecture
- Prometheus가 EKS 클러스터에서 메트릭을 수집합니다
- Node Exporter가 노드 메트릭을 수집합니다
- kube-state-metrics가 Kubernetes 객체 데이터를 제공합니다
- Grafana가 대시보드에 메트릭을 표시합니다
Step 1: Create Monitoring Namespace
(선호하는 kubectl 명령으로 네임스페이스를 생성하세요.)
Step 2: Deploy kube-state-metrics
Components deployed
- Pods
- Namespaces
- Nodes
- Deployments
Verify deployment
kubectl get pods -n monitoring
Step 3: Deploy Node Exporter
Collects
- CPU
- Memory
- Disk metrics
평소에 사용하던 kubectl 명령으로 상태를 확인하세요.
Step 4: Configure Prometheus
Prometheus 스크래핑 구성을 업데이트하여 다음으로부터 메트릭을 수집합니다:
- Kubernetes 노드
- Pods
- kube-state-metrics
- kubelet 메트릭
Grafana 필터링에 사용할 라벨
clusternodenamespacepod
Step 5: Connect Grafana to Prometheus
- Grafana 열기
- Prometheus를 데이터 소스로 추가
- 연결을 저장하고 테스트
Step 6: Import Dashboards
Kubernetes 대시보드를 가져와서 다음을 확인합니다:
- 클러스터 메트릭
- 노드 사용량
- 파드 사용량
다음 기준으로 필터링할 수 있습니다:
- Cluster
- Node
- Namespace
- Pod
What You Can Monitor
- 클러스터 상태
- 노드 CPU 및 메모리
- 파드 리소스 사용량
- 파드 재시작 횟수
What I Learned
- 모니터링은 Kubernetes에 필수적임
- Helm 없이도 Prometheus와 Grafana를 잘 활용할 수 있음
- 라벨은 메트릭 필터링에 매우 유용함
- 좋은 모니터링은 DevSecOps 실천을 지원함
Conclusion
Helm 없이 Amazon EKS를 모니터링하는 간단하고 효과적인 방법입니다. Kubernetes 모니터링을 배우는 모든 사람에게 좋은 출발점이 될 것입니다.
읽어 주셔서 감사합니다!