
깃 다운로드
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
설치
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

설치
kubectl apply -f ground/k8s-1.27/loki-stack-2.6.1
설치 확인
kubectl get pods -n loki-stack

▶ 접속 URL : http://192.168.56.30:30001
▶ 로그인 : id: admin, pw: admin
▶ Connect data : Home > Connections > Connect data
▶ 검색에 [loki] 입력 후 항목 클릭
▶ URL에 내용 입력 : http://loki-stack.loki-stack:3100
▶ 하단 Save & Test
cd monitoring
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
kubectl delete -f ground/k8s-1.27/loki-stack-2.6.1