ARM 서버에 Kubernetes 클러스터 구축하기 (3) - 모니터링 스택 (Prometheus + Grafana)
들어가며 이전 글에서 3노드 Kubernetes 클러스터를 완성했습니다. 이번 글에서는 클러스터의 상태를 모니터링하기 위한 Prometheus + Grafana 모니터링 스택을 구축하는 과정을 다룹니다. 구축 목표 ✅ Prometheus: 메트릭 수집 및 저장 ✅ Grafana: 메트릭 시각화 및 대시보드 ✅ PersistentVolume: 데이터 영구 보존 ✅ NodePort: 외부 접근 가능 아키텍처 개요 ┌─────────────────────────────────────────────────────┐ │ Kubernetes Cluster (3 nodes) │ ├─────────────────────────────────────────────────────┤ │ Master: k8s-master (<마스터_노드_IP>) │ │ Workers: k8s-worker1, k8s-worker2 │ ├─────────────────────────────────────────────────────┤ │ Monitoring Namespace │ ├─────────────────────────────────────────────────────┤ │ ┌──────────────┐ ┌──────────────┐ │ │ │ Prometheus │ │ Grafana │ │ │ │ Port 9090 │─────────│ Port 3000 │ │ │ │ Storage: 10Gi│ │ Storage: 10Gi│ │ │ └──────────────┘ └──────────────┘ │ ├─────────────────────────────────────────────────────┤ │ Services │ ├─────────────────────────────────────────────────────┤ │ Prometheus: NodePort 32664 (9090) │ │ Grafana: NodePort 31211 (3000) │ └─────────────────────────────────────────────────────┘ 사전 준비 1. 클러스터 상태 확인 1 2 3 4 5 6 7 8 9 10 11 # 마스터 노드에 SSH 접속 ssh ubuntu@<마스터_노드_IP> # 클러스터 상태 확인 kubectl get nodes -o wide # 예상 출력 NAME STATUS ROLES AGE VERSION k8s-master Ready control-plane 27h v1.29.15 k8s-worker1 Ready <none> 27h v1.29.15 k8s-worker2 Ready <none> 27h v1.29.15 2. 필요한 도구 설치 1 2 3 4 5 6 # kubectl (이미 설치됨) kubectl version --client # Helm 설치 (패키지 관리자) curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash helm version Namespace 생성 모니터링 관련 리소스를 전용 namespace에 배치합니다. ...