BOOOO0 / eks

EKS Terraform
0 stars 0 forks source link

EKS

Helm

Terraform

모니터링

# add prometheus Helm repo
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

# add grafana Helm repo
helm repo add grafana https://grafana.github.io/helm-charts

# 프로메테우스 설치
kubectl create namespace prometheus
helm install prometheus prometheus-community/prometheus \
--namespace prometheus \
--set alertmanager.persistentVolume.storageClass="gp2" \
--set server.persistentVolume.storageClass="gp2"

# 프로메테우스가 수집하는 데이터를 grafana의 datasource로 명시
mkdir ${HOME}/grafana

cat << EoF > ${HOME}/grafana/grafana.yaml
datasources:
  datasources.yaml:
    apiVersion: 1
    datasources:
    - name: Prometheus
      type: prometheus
      url: http://prometheus-server.prometheus.svc.cluster.local
      access: proxy
      isDefault: true
EoF

# 그라파나 설치
kubectl create namespace grafana
helm install grafana grafana/grafana \
    --namespace grafana \
    --set persistence.storageClassName="gp2" \
    --set persistence.enabled=true \
    --set adminPassword='Mon!tor123' \
    --values ${HOME}/grafana/grafana.yaml \
    --set service.type=LoadBalancer