728x90
<Prometheus>
컨테이너화된 환경에서 시스템 및 서비스 모니터링을 위한 오픈 소스 시스템
1. git에서 실습을 위한 monitoring 리소스 가져오기
- 외부 리포지토리에서 원하는 디렉토리만 선택적으로 가져오는 작업 수행
- sparse checkout을 통해 특정 디렉토리만 로컬에 유지
- Sparse checkout: Git에서 리포지토리의 일부 파일 또는 디렉토리만 로컬에 체크아웃하는 기능
ubuntu@k8s-master:~$ git init monitoring
>> monitoring 저장소 생성
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m
Initialized empty Git repository in /home/ubuntu/monitoring/.git/
ubuntu@k8s-master:~$ ls
2163 cd Desktop Downloads Music Public snap Videos
calico.yaml dashboard_rbac Documents **monitoring** Pictures pwd Templates
ubuntu@k8s-master:~$ cd monitoring/
ubuntu@k8s-master:~/monitoring$ git config --global init.defaultBranch main
>> 저장소를 초기화한 후, 기본 브랜치 이름
- sparse checkout 활성화
- origin 원격 저장소에서 로컬 브랜치에 병합
ubuntu@k8s-master:~/monitoring$ git config core.sparseCheckout true
ubuntu@k8s-master:~/monitoring$ echo "ground/k8s-1.27/prometheus-2.44.0" >> .git/info/sparse-checkout
ubuntu@k8s-master:~/monitoring$ echo "ground/k8s-1.27/loki-stack-2.6.1" >> .git/info/sparse-checkout
ubuntu@k8s-master:~/monitoring$ git pull origin main
From <https://github.com/k8s-1pro/install>
* branch main -> FETCH_HEAD
2. 모니터링을 위한 리소스 서버에 생성 확인
3. 클러스터에 Prometheus와 Loki 배포
ubuntu@k8s-master:~/monitoring$ kubectl apply --server-side -f ground/k8s-1.27/prometheus-2.44.0/manifests/setup
ubuntu@k8s-master:~/monitoring$ kubectl wait --for condition=Established --all CustomResourceDefinition --namespace=monitoring
ubuntu@k8s-master:~/monitoring$ kubectl apply -f ground/k8s-1.27/prometheus-2.44.0/manifests
secret/grafana-config createdubuntu@k8s-master:~/monitoring$ kubectl apply -f ground/k8s-1.27/loki-stack-2.6.1
namespace/loki-stack created
'클라우드 + DevOps > Kubernetes (k8s)' 카테고리의 다른 글
Kubernetes :: Application Pod 배포 실습 (0) | 2024.04.15 |
---|---|
쿠버네티스 아키텍처 - 오브젝트 이론 (0) | 2024.04.15 |
Kubernetes 실습 :: Kubernetes 대시보드 모니터링 실습 (1) (0) | 2024.04.13 |
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (6) 대시보드 인증서 생성 (1) | 2024.04.12 |
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (5) 대시보드 생성 (0) | 2024.04.11 |