Monitoring

Istio, Kiali 설치 및 Prometheus, Grafana 연결 (Using Helm)

황동리 2025. 7. 24. 17:20
반응형

Istio는 수 많은 파드와 파드 사이의 트래픽을 관찰 할 수 있는 서비스 메쉬 툴 입니다.
https://istio.io/latest/docs/setup/install/helm/
https://kiali.io/docs/installation/installation-guide/install-with-helm/

  1. Helm 설치 (Mac 사용자)

    brew install helm
  2. helm 저장소 구성

    helm repo add istio-official https://istio-release.storage.googleapis.com/charts 
    helm repo update
  3. istio-base 설치

    helm install my-base istio-official/base --version 1.26.0
  4. istiod 설치

    helm install istiod istio-official/istiod --version 1.26.0
  5. istio-gateway 설치

    helm install istio-gateway istio-official/gateway --version 1.26.0
  6. kiali-values.yaml 내용 정리

    cr:
       create: true
       name: kiali
       namespace: "istio-system"
       annotations: {}
    
    # Prometheus와 Grafana 연결
    # Prometheus 연결이 안 되어 있으면 트래픽 그래프에 아무것도 표시되지 않습니다.
    
    spec:  
     deployment:  
       cluster_wide_access: true  
     external_services:  
       prometheus:  
         url: "http://<k8s 클러스터에 설치된 Prometheus 서비스의 이름>.<Prometheus가 설치된 네임스페이스 이름>.svc.cluster.local:9090"  
         auth:  
           type: "none"  
       grafana:  
         enabled: true  
         internal_url: "http://<k8s 클러스터에 설치된 Grafana 서비스의 이름>.<Grafana가 설치된 네임스페이스 이름>.svc.cluster.local:80"  
         external_url: "<Grafana의 외부 노출 주소>"  
         auth:  
           type: "basic"  
           username: "<Grafana 로그인 ID>"  
           password: "<Grafana 로그인 Password>"
  7. kiali 설치

    helm repo add kiali https://kiali.org/helm-charts
    helm repo update
    helm install \
     --set cr.create=true \
     --set cr.namespace=istio-system \
     --set cr.spec.auth.strategy="anonymous" \
     --namespace kiali-operator \
     --create-namespace \
     kiali-operator \
     kiali/kiali-operator -f kiali-values.yaml
  8. 프로메테우스가 Istio로 부터 메트릭을 받아오려면 serviceMonitor 리소스를 생성해야 합니다.

    apiVersion: monitoring.coreos.com/v1
    kind: ServiceMonitor
    metadata:
    name: istiod
    namespace: istio-system
    labels:
     release: monitor # 여기에는 프로메테우스의 라벨 확인해서 넣어주면 됩니다.
    spec:
    selector:
     matchLabels:
       app: istiod # istiod의 라벨 확인해서 넣어주면 됩니다.
    namespaceSelector:
     matchNames:
       - istio-system
    endpoints: # istiod 파드가 사용하고 있는 포트 확인해서 넣어주면 됩니다.
     - port: http-monitoring
       interval: 15s
  9. Envoy 사이드카가 배포된 파드로 부터 메트릭 받아오려면 podMonitor 리소스도 생성해야 합니다.

    apiVersion: monitoring.coreos.com/v1
    kind: PodMonitor
    metadata:
    name: istio-envoy
    namespace: istio-system
    labels:
     release: monitor # 여기에는 프로메테우스의 라벨 확인해서 넣어주면 됩니다.
    spec:
    namespaceSelector:
     any: true  # 모든 네임스페이스의 사이드카 감지
    selector:
     matchLabels:
       security.istio.io/tlsMode: istio  # 모든 Envoy 사이드카에 붙는 기본 라벨
    podMetricsEndpoints:
     - port: http-envoy-prom  # 15020 포트의 이름(서비스/파드에 따라 다를 수 있음)
       path: /stats/prometheus
       interval: 15s

이상 입니다.

반응형