쿠버네티스 모니터링 Prometheus(with Grafana), Loki-Stack yaml 다운로드

KIM HYUNMIN·2024년 8월 23일

쿠버네티스

목록 보기
4/16

Prometheus(with Grafana), Loki-Stack yaml 다운로드

깃 다운로드

yum -y install git

로컬 저장소 생성

git init monitoring
git config --global init.defaultBranch main
cd monitoring

remote 추가

git remote add -f origin https://github.com/k8s-1pro/install.git

sparse checkout 설정

git config core.sparseCheckout true
echo "ground/k8s-1.27/prometheus-2.44.0" >> .git/info/sparse-checkout
echo "ground/k8s-1.27/loki-stack-2.6.1" >> .git/info/sparse-checkout

다운로드

git pull origin main

Prometheus(with Grafana) 설치

설치

kubectl apply --server-side -f ground/k8s-1.27/prometheus-2.44.0/manifests/setup
kubectl wait --for condition=Established --all CustomResourceDefinition --namespace=monitoring
kubectl apply -f ground/k8s-1.27/prometheus-2.44.0/manifests

설치 확인

kubectl get pods -n monitoring

Loki-Stack 설치

설치

kubectl apply -f ground/k8s-1.27/loki-stack-2.6.1

설치 확인

kubectl get pods -n loki-stack

Grafana 접속

▶ 접속 URL : http://192.168.56.30:30001

▶ 로그인 :​ id: admin, pw: admin

Grafana에서 Loki-Stack 연결

▶ Connect data : Home > Connections > Connect data

▶ 검색에 [loki] 입력 후 항목 클릭

▶ URL에 내용 입력 : http://loki-stack.loki-stack:3100

▶ 하단 Save & Test

Prometheus(with Grafana), Loki-stack 삭제

cd monitoring

Prometheus 삭제

kubectl delete --ignore-not-found=true -f ground/k8s-1.27/prometheus-2.44.0/manifests -f ground/k8s-1.27/prometheus-2.44.0/manifests/setup

Loki-stack 삭제

kubectl delete -f ground/k8s-1.27/loki-stack-2.6.1

출처:https://cafe.naver.com/kubeops

profile
Linux,Window,Network,docker,kubernets

0개의 댓글