반응형

작성일: 2023년 10월 25일

 

내가 참고했던 문서:  https://semaphoreci.com/blog/prometheus-grafana-kubernetes-helm

 

Helm chart를 사용하면, 키보드로 명령을 몇 줄 입력하면 모든 설치 및 구성이 끝난다.

내가 수행했던 명령을 캡쳐했다. 아래 예제를 따라하면 잘 설치된다.

 

/home/sejong/chart/prometheus# helm install -n almighty prometheus ./

NAME: prometheus
LAST DEPLOYED: Wed Oct 25 18:01:27 2023
NAMESPACE: almighty
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster:
prometheus-server.almighty.svc.cluster.local


Get the Prometheus server URL by running these commands in the same shell:
  export POD_NAME=$(kubectl get pods --namespace almighty -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace almighty port-forward $POD_NAME 9090


The Prometheus alertmanager can be accessed via port 9093 on the following DNS name from within your cluster:
prometheus-alertmanager.almighty.svc.cluster.local


Get the Alertmanager URL by running these commands in the same shell:
  export POD_NAME=$(kubectl get pods --namespace almighty -l "app.kubernetes.io/name=alertmanager,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace almighty port-forward $POD_NAME 9093
#################################################################################
######   WARNING: Pod Security Policy has been disabled by default since    #####
######            it deprecated after k8s 1.25+. use                        #####
######            (index .Values "prometheus-node-exporter" "rbac"          #####
###### .          "pspEnabled") with (index .Values                         #####
######            "prometheus-node-exporter" "rbac" "pspAnnotations")       #####
######            in case you still need it.                                #####
#################################################################################


The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster:
prometheus-prometheus-pushgateway.almighty.svc.cluster.local


Get the PushGateway URL by running these commands in the same shell:
  export POD_NAME=$(kubectl get pods --namespace almighty -l "app=prometheus-pushgateway,component=pushgateway" -o jsonpath="{.items[0].metadata.name}")
  kubectl --namespace almighty port-forward $POD_NAME 9091

For more information on running Prometheus, visit:
https://prometheus.io/

/home/sejong/WorkSpace/chart/prometheus#


---



/home/sejong/chart/grafana# helm install -n almighty grafana ./

NAME: grafana
LAST DEPLOYED: Wed Oct 25 18:37:27 2023
NAMESPACE: almighty
STATUS: deployed
REVISION: 1
NOTES:
1. Get your 'admin' user password by running:

   kubectl get secret --namespace almighty grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo


2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster:

   grafana.almighty.svc.cluster.local

   Get the Grafana URL to visit by running these commands in the same shell:
     export POD_NAME=$(kubectl get pods --namespace almighty -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}")
     kubectl --namespace almighty port-forward $POD_NAME 3000

3. Login with the password from step 1 and the username: admin

/home/sejong/WorkSpace/chart/grafana#


---


## Grafana admin 계정 암호 찾기

$  kubectl get secret --namespace almighty grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
gxq5MbMBa2w5qkqpvkaYGU5T8bJDOTag9ayy5kxi

 

 

Helm chart가 잘 만들어져 있어서 큰 노력없이 클러스터 구축이 끝났다.

Helm chart를 만든 분께 감사하다는 말을 전하고 싶다.

+ Recent posts