Grafana를 설정하기 전에
더보기
AWS EKS Console에 접속하여 "추가기능"에서 EBS CSI Driver를 추가해줘야 합니다
EBS CSI Driver를 추가하면 이런 JSON형태가 뜨는데
<OIDC>:sub 뒤에 "system:serviceaccount:kube-system:ebs-csi-controller-sa"를 추가한뒤 저장해주세요
더보기
Eks Cluster에서 사용하는 모든 퍼블릭 서브넷에 태그를 추가해줍니다.
kubernetes.io/role/elb
Eks Cluster에서 사용하는 모든 프라이빗 서브넷에 태그를 추가해줍니다.
kubernetes.io/role/internal-elb
Helm으로 Grafana를 설치해줍니다
helm repo add grafana https://grafana.github.io/helm-charts
Grafana를 삭제해줍니다
helm uninstall prometheus prometheus-community/prometheus -n prometheus
Create Grafana.yml
cat <<EOF >> grafana.yml
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server.prometheus.svc.cluster.local
access: proxy
isDefault: true
service:
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
EOF
Create Grafana Namespace & Grafana NLB
kubectl create namespace grafana
helm install grafana grafana/grafana \
--namespace grafana \
--set persistence.storageClassName="gp2" \
--set persistence.enabled=true \
--set adminPassword='Skills2024**' \
--values /home/ec2-user/grafana.yml \
--set service.type=LoadBalancer
위 코드를 사용하면 Grafana용 NLB가 생성됩니다.
Grafana NLB에 DNS에 접속하면 로그인 창이 뜨는데
ID : admin
PW : Skills2024**
으로 접속해주면 됩니다 아이디랑 비밀번호는 오른쪽 설정에서 변경할 수 있습니다.
대시보드를 추가할려면 위의 링크로 접근하여 대시보드ID를 가져와서 NLB의 DNS에서 추가해주면 됩니다.