2. Prometheus
• History
• SoundCloud라는 곳에서 시작
• 2012년 이후 여러회사에서 참여
• 2016에 Cloud Native Computing Foundation에 합류 (k8s에 이은 두번째 공식 프로젝트)
• 주요기능
• 멀티 디맨젼 지원 데이터 모델 (multi-demensional data model)
• 유연한 조회언어 (query language)
• 분산스토리지에 의존성없음
• http 프로토콜을 사용한 시계열데이터 수집
• Severside pull 데이터 수집 및 push gateway를 통한 Spot data지원
• Service Discovery나 Static 모두 사용가능한 구조
• 그래프나 대시보드를 위한 다양한 모드 제공
• 적용대상
• 순수하게 숫자로 구성된 시계열 데이터 저장에 적합
• Reliable 하지만 성숙도가 부족하여 billing 등 사용 부적합
5. Job&Instance
• Instance: 수집대상
• Job: 동일한 동작을 하는 instance 들에 대한 수집
• 수집시 자동으로 부여되는 labels and time series
• labels
• Job 명칭
• Instace 구분: <host>:<port>
• Honor_labels
• 시간
• up{job=<job-name>, instance=<instance-id>}: 1 (살았니 죽었니)
• scrap_duration_seconds{job=<job-name>, instance=<instance-id>}: 수집에
걸린 시간
• scrap_samples_post_metric_relabeling{job=<job-name>,
instance=<instance-id>}: relabeling 이후 샘플 수
• scrap_samples_scraped{job=<job-name>, instance=<instance-id>}:: 수집된
샘플 수
8. 8
II. Helm > What is Helm TBU
https://helm.sh/
Helm은 kubernetes에 어플리케이션을 설치하고 관리하는 툴이다. 마치 운영체제에 어플리케이션을 설치
하고 관리하는 apt, yum, homebrew와 같은 툴의 kubernetes 버전이라 할 수 있다.
Helm can do the following:
• Create new charts(kubernetes packages) from scratch
• Package charts into chart archive (tgz) files
• Interact with chart repositories where charts are stored
• Install and uninstall charts into an existing Kubernetes cluster
• Manage the release cycle of charts that have been installed with Helm
For Helm, there are three important concepts:
1. The chart is a bundle of information necessary to create an instance of a Kubernetes
application.
2. The config contains configuration information that can be merged into a packaged chart
to create a releasable object.
3. A release is a running instance of a chart, combined with a specific config.
9. What is helm?
The package manager for Kubernetes
Helm helps you manage Kubernetes applications - Helm
Charts helps you define, install, and upgrade even the most
complex Kubernetes application.
Charts are easy to create, version, share, and publish - so
start using Helm and stop the copy-and-paste madness.
11. Prometheus charts
• 이점
• Helm Chart를 통한 간편한 배포
• Prometheus서버에 exporter들을 등록
• grafana의 데이터 소스로 prometheus를 지정
• grafana내 기본 dashboard 제공
• Ceph관련 3종: Cluster, OSD, Pools
• ElasticSearch
• Kubernetes관련 2종: Capacity Planning, Status
• Nginx: 모든 서비스에서 발생하는 nginx 감시
• Node
• OpenStack관련 2종:
Metrics, Service
• RabbitMQ
12. Just git clone & install
• Openstack-helm 관련 공식 repo는 없음 -> 소스를 통한 설치
• git clone https://github.com/openstack/openstack-helm-
infra
• cd openstack-helm-infra
• make helm-toolkit; mkdir prometheus/charts; cp helm-
toolkit.*.tz prometheus/charts
• helm install prometheus …
13. TACO-scripts
• https://github.com/sktelecom-oslab/taco-scripts
• SKT에서 개발하고 있는 OpenStack 패키지인 TACO의 오픈소스버전
• Hands-on 진행
• OpenStack Days 2017, OpenInfra Days 2018
• OpenStack Summit in Vancouver 2018
• OS만 설치된 서버에 간단하게 Kubernetes cluster와 OpenStack와 제반 소프트웨어를 배포
하는 방법 제공
• 4 core / 8 GB / 200 GB 이상의 BM 또는 VM 준비
• 010~040 스크립트를 차례로 실행
• 스크립트별 수행내역
• 010-init-env.sh: 초기환경설정
• 020-install-k8s.sh: kubernetes cluster 구축 및 초기정보 입력
• 030-install-armada.sh: 배포를 위한 armada(Airship) 구축
• 040-deploy-openstack.sh: OpenStack 컴포넌트 구축
• 041-deploy-mon.sh: Prometheus 구축
16. TACO-scripts
• 더 많은 컴포넌트 설치를 위한 수정방법
• cd ~/apps/armada-manifests/
• vi taco-mon-manifest.yaml
• 최하단의 주석부분 주석(#)삭제
• armada apply taco-mon-manifest.yaml
• 이를 통해 설치되는 내역
• Kubernetes exporter
• Openstack exporter
• Alert manager: 알람에 대한 노티피케이션 설정
17. Configuration
• 변경포인트
• conf.prometheus.command_lin
e_flags
• 저장 주기 설정
• API를 통한 관리 설정
• conf.prometheus.scrap_configs
• Prometheus 설정파일 전체
• Scrape 대상 및 주기 등
• helm을 통한 구축시
• valueoverride를 통해 재지정
• armada를 통한 구축시
• manifest 파일에서 해당부분 수정
및 apply
• Manifest 파일은 여러 helm chart
를 포함하고 있으므로 depth가 다름
• data.values.conf…
18. 결론
• Prometheus는 kubernetes 모니터링을 위한 최적 솔루션
• OpenStack-helm 프로젝트에서는 kubernetes 감시를 포함한
Prometheus의 주요 부분에 대한 helm chart를 제공
• osh에서 제공된 helm chart를 통해 구성하면 개별 sw가 유기적
으로 결합된 형태의 결과까지 받을 수 있음
• osh기반 prometheus를 간단하게 환경을 구축하고 테스트 해볼수
있는 TACO-scripts가 존재