EKS Mornitoring - 1. Prometheus & Grafana 세팅 (tistory.com)
sudo curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
sudo chmod 700 get_helm.sh
./get_helm.sh
kubectl create ns monitoring
#헬름 설치 및 prometheus operator 설치
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm upgrade --install prometheus-operator prometheus-community/kube-prometheus-stack --namespace monitoring
ubuntu@ip-192-168-20-94:~$ kubectl get all -n monitoring
NAME READY STATUS RESTARTS AGE
pod/alertmanager-prometheus-operator-kube-p-alertmanager-0 2/2 Running 0 2m5s
pod/prometheus-operator-grafana-6cc7566658-2gvh9 3/3 Running 0 2m10s
pod/prometheus-operator-kube-p-operator-546f875ff8-22pnz 1/1 Running 0 2m10s
pod/prometheus-operator-kube-state-metrics-6fd995f5b4-6zpdx 1/1 Running 0 2m10s
pod/prometheus-operator-prometheus-node-exporter-f7s97 1/1 Running 0 2m11s
pod/prometheus-operator-prometheus-node-exporter-qfrps 1/1 Running 0 2m11s
pod/prometheus-prometheus-operator-kube-p-prometheus-0 2/2 Running 0 2m3s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/alertmanager-operated ClusterIP None <none> 9093/TCP,9094/TCP,9094/UDP 2m5s
service/prometheus-operated ClusterIP None <none> 9090/TCP 2m3s
service/prometheus-operator-grafana ClusterIP 10.100.65.62 <none> 80/TCP 2m11s
service/prometheus-operator-kube-p-alertmanager ClusterIP 10.100.98.169 <none> 9093/TCP,8080/TCP 2m11s
service/prometheus-operator-kube-p-operator ClusterIP 10.100.144.66 <none> 443/TCP 2m11s
service/prometheus-operator-kube-p-prometheus ClusterIP 10.100.24.46 <none> 9090/TCP,8080/TCP 2m11s
service/prometheus-operator-kube-state-metrics ClusterIP 10.100.114.160 <none> 8080/TCP 2m11s
service/prometheus-operator-prometheus-node-exporter ClusterIP 10.100.142.106 <none> 9100/TCP 2m11s
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/prometheus-operator-prometheus-node-exporter 2 2 2 2 2 kubernetes.io/os=linux 2m11s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/prometheus-operator-grafana 1/1 1 1 2m11s
deployment.apps/prometheus-operator-kube-p-operator 1/1 1 1 2m11s
deployment.apps/prometheus-operator-kube-state-metrics 1/1 1 1 2m11s
NAME DESIRED CURRENT READY AGE
replicaset.apps/prometheus-operator-grafana-6cc7566658 1 1 1 2m11s
replicaset.apps/prometheus-operator-kube-p-operator-546f875ff8 1 1 1 2m11s
replicaset.apps/prometheus-operator-kube-state-metrics-6fd995f5b4 1 1 1 2m11s
NAME READY AGE
statefulset.apps/alertmanager-prometheus-operator-kube-p-alertmanager 1/1 2m5s
statefulset.apps/prometheus-prometheus-operator-kube-p-prometheus 1/1 2m3s
kubectl --namespace monitoring get pods -l "release=prometheus-operator"
sudo mv /tmp/eksctl /usr/local/bin
eksctl version
# namespace, cluster 변경 ~!!!
eksctl create iamserviceaccount \
--name ebs-csi-controller-sa \
--namespace kube-system \
--cluster houstagram-eks-app \
--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \
--approve \
--role-only \
--role-name AmazonEKS_EBS_CSI_DriverRole
oidc_id=$(aws eks describe-cluster --name houstagram-eks-app --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5)
# 지역과 클러스터 변경하니깐 확인하기!
eksctl utils associate-iam-oidc-provider --region ap-northeast-2 --cluster houstagram-eks-app --approve
잘봤습니다.