| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
- 코틀린 코루틴의 정석
- APM
- minikube
- tucker의 go 언어 프로그래밍
- 바이브코딩
- MySQL
- golang
- kotlin
- CKA 기출문제
- AI
- 기록으로 실력을 쌓자
- go
- 공부
- PETERICA
- Rag
- 정보처리기사 실기 기출문제
- CKA
- LLM
- SRE
- 오블완
- 티스토리챌린지
- kotlin coroutine
- Kubernetes
- Spring
- AWS EKS
- aws
- Pinpoint
- CloudWatch
- Linux
- Java
- Today
- Total
피터의 개발이야기
[kubernetes] Prometheus Monitoring 환경 구축하기 본문
[kubernetes] Prometheus Monitoring 환경 구축하기
기록하는 백앤드개발자 2022. 7. 14. 15:20
ㅁ 개요
ㅇ 쿠버네티스로 Prometheus Monitoring 환경 구축하기
ㅁ minikube cluster 생성
minikube start --cpus 4 --memory 8192 --vm-driver hyperkit

ㅁ repo 추가
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add stable https://charts.helm.sh/stable
helm repo update

ㅁ char 설치
helm install prometheus prometheus-community/kube-prometheus-stack

ㅁ 설치된 쿠버네티스 환경 확인
ㅇ 쿠버네티스 환경으로 prometheus 설정이 완료되었다.
ㅇ 하지만 grafana가 내부망으로만 설정되어 있어, 외부에서 접속할 수 있도록 설정이 필요하다.
ㅇ service/prometheus-grafana는 생성이 되었지만 External-ip가 없으니 cluster 내부로만 통신이 가능한 상태이다.
ㅁ grafana 로그 확인
kubectl logs prometheus-grafana-5bdf858fc5-z6c49 -c grafana

ㅇ 기본 사용자로 admin이 생성되었고, http listen으로 3000 포트가 세팅되어 있는 것을 확인하였다
ㅁ Port Forward 설정
kubectl port-forward deployments/prometheus-grafana 3000

ㅁ Grafana 접속


ㅇ 어드민 비번은 "prom-operator"이다.
ㅁ 쿠버네티스 대시보드 목록


ㅁ Prometheus UI 연결
kubectl describe pod prometheus-prometheus-kube-prometheus-prometheus-0
** 생략 **
Containers:
prometheus:
Container ID: docker://ad2f4c673664fa6f9cb09cd27a288840ed7e677adefd78cf9719b17ef447d76a
Image: quay.io/prometheus/prometheus:v2.36.1
Image ID: docker-pullable://quay.io/prometheus/prometheus@sha256:f4c5fa1018a5c15f81250b8122f36f90146d5c2b323f9ec1f41d1b36dc0e7cb9
Port: 9090/TCP
Host Port: 0/TCP
** 생략 **
ㅇ 컨테이너의 포트는 9090 이다.
kubectl port-forward prometheus-prometheus-kube-prometheus-prometheus-0 9090
ㅇ port forward 연결을 한다.

ㅇ http://localhost:9090으로 접속을 하였다.

ㅇ Alert 탭을 선택한 화면이다.

ㅇ Status > Runtime & Build Information 에서 현재 정보를 확인 할 수 있다.
ㅁ 함께 보면 좋은 사이트
ㅇ https://github.com/helm/charts/tree/master/stable/prometheus-operator
GitHub - helm/charts: ⚠️(OBSOLETE) Curated applications for Kubernetes
⚠️(OBSOLETE) Curated applications for Kubernetes. Contribute to helm/charts development by creating an account on GitHub.
github.com
ㅇ https://youtu.be/QoDqxm7ybLc
'Kubernetes > Logging & Monitoring' 카테고리의 다른 글
| [Kubernetes] Spring에서 쿠버네티스 Pod 정보조회 (0) | 2023.01.26 |
|---|---|
| [Kubernetes] 쿠버네티스API 서버 CURL 접속 방법 (0) | 2023.01.25 |
| [kubernetes] Events 시간 단위로 소팅 (1) | 2023.01.17 |
| [kubernetes] Events 보는 방법 (0) | 2022.09.23 |
| [kubernetes] node와 pod의 CPU, 메모리 확인 방법 (0) | 2022.08.19 |

