helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
mkdir grafana_prometheus
cd grafana_prometheus
ํฌ๋ฆ ๋ฐฐํฌ๋ฅผ ์ํ values.yaml ์์ฑํ ๋๋ ํฐ๋ฆฌ ์์ฑ
cat << EOF > values-prometheus.yaml
values-prometheus.yaml
server: enabled: true persistentVolume: enabled: true accessModes: - ReadWriteOnce mountPath: /data size: 100Gi replicaCount: 1 retention: "15d" #ํ๋ก๋ฉํ ์ฐ์ค ๋ฐ์ดํฐ ๋ณด์ ๊ธฐ๊ฐ
cat << EOF > values-grafana.yaml
values-grafana.yaml
replicas: 1 service: type: LoadBalancer persistence: type: pvc enabled: true # storageClassName: default accessModes: - ReadWriteOnce size: 10Gi # annotations: {} finalizers: - kubernetes.io/pvc-protection adminUser: admin adminPassword: test1234
kubectl create ns prometheus
helm install prometheus prometheus-community/prometheus -f values-prometheus.yaml -n prometheus
helm install grafana grafana/grafana -f values-grafana.yaml -n prometheus
์์ ์ค์ ํ๋ admin ๋ก๊ทธ์ธ ์ ๋ณด๋ก ๋ก๊ทธ์ธํ๊ธฐ
URL์ ClusterIP ์ด๋ฆ์ ๋ฃ์ผ๋ฉด ๋จ. (prometheus-server) , ๋ค์์คํ์ด์ค๋ค๋ฅด๋ฉด ๋ ์ค์ ํด์ค์ผํ
https://grafana.com/grafana/dashboards/7550-kubernetes-cluster-monitoring-prometheus/