prometheus란?
prometheus 사용하는 이유?
1) 3개의 노드 시간 동기화
[root@k8s-master ~]# rdate -s time.bora.net
[root@k8s-master ~]# date
2) prometheus, grafana에 필요한 yaml 파일 실행
[root@k8s-master ~]# cd k8s-prometheus/
[root@k8s-master k8s-prometheus]# kubectl create namespace monitoring
[root@k8s-master k8s-prometheus]# tree
# prometheus, grafana에 필요한 모든 yaml 파일 실행
[root@k8s-master k8s-prometheus]# kubectl create -f prometheus/prometheus-ConfigMap.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f prometheus/prometheus-ClusterRoleBinding.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f prometheus/prometheus-ClusterRole.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f prometheus/prometheus-Deployment.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f prometheus/prometheus-Service.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f prometheus/prometheus-DaemonSet-nodeexporter.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f kube-state/kube-state-ClusterRoleBinding.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f kube-state/kube-state-ClusterRole.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f kube-state/kube-state-ServiceAccount.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f kube-state/kube-state-Deployment.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f kube-state/kube-state-Service.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f grafana/grafana-Deployment.yaml
[root@k8s-master k8s-prometheus]# kubectl create -f grafana/grafana-Service.yaml
기본 브라우저
grafana & prometheus 연결
1) grafana 접속(http://192.168.56.100:30004)
2) *(톱니)모양 > configuration
3) Add data source 클릭
4) Prometheus 클릭
5) URL 에서 http://192.168.56.100:30003 입력
6) 하단의 save & test 버튼 클릭
7) Dashboard > import > 깔끔한 grafana template (6417, 10000, 315)