본문 바로가기
[GPUaaS]/Prometheus

[NCP 실전] NCP Kubernetes + Prometheus + Alertmanager 환경에Thanos + NCP Object Storage 연동

by METAVERSE STORY 2026. 1. 13.
반응형

 

 



NCP Kubernetes + Prometheus + Alertmanager 환경에
Thanos + NCP Object Storage(S3 API) 까지 붙이면 “GPU 장기 이력 + 감사 + 비용 분석” 이 완성됩니다.

아래는 운영 환경에서 바로 쓰는 표준 설치 가이드 (명령어 중심) 입니다.


🧩 전체 아키텍처

 
Prometheus
   │ (sidecar)
   ▼
Thanos Sidecar
   │
   ▼
NCP Object Storage (S3 API)
   │
   ▼
Thanos Store
   │
   ▼
Thanos Query → Grafana

 

 

 


🧩 1️⃣ NCP Object Storage S3 정보 준비

NCP 콘솔 → Object Storage → 버킷 생성


예:

  • Bucket: ncp-prometheus-metrics
  • Region: kr-standard

S3 API 정보:

항목값
Endpoint https://kr.object.ncloudstorage.com
AccessKey NCP 콘솔
SecretKey NCP 콘솔

 

 

 


🧩 2️⃣ Thanos S3 설정 Secret 생성

 
cat <<EOF > thanos-objstore.yaml
type: S3
config:
  bucket: "ncp-prometheus-metrics"
  endpoint: "kr.object.ncloudstorage.com"
  access_key: "NCP_ACCESS_KEY"
  secret_key: "NCP_SECRET_KEY"
  insecure: false
  signature_version2: false
EOF
 
 

 

 

 
kubectl create secret generic thanos-objstore \
  --from-file=thanos.yaml=thanos-objstore.yaml \
  -n monitoring

 

 

 

 


🧩 3️⃣ Thanos Helm Repo 추가

 
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

 

 

 

 


🧩 4️⃣ Prometheus에 Thanos Sidecar 연결

Prometheus에 sidecar 붙여야 함.

values 파일 생성:

 
cat <<EOF > prometheus-thanos.yaml
prometheus:
  prometheusSpec:
    thanos:
      objectStorageConfig:
        name: thanos-objstore
        key: thanos.yaml
EOF
 
 
 
 

업그레이드

 
helm upgrade prometheus prometheus-community/kube-prometheus-stack \
  -n monitoring \
  -f prometheus-thanos.yaml
 
 
 
 

확인

 
kubectl get pods -n monitoring | grep thanos

→ prometheus pod 안에 thanos-sidecar 컨테이너 생김

 

 


🧩 5️⃣ Thanos Query + Store + Compactor 설치

 
helm install thanos bitnami/thanos \
  -n monitoring \
  --set objstoreConfig.secretName=thanos-objstore \
  --set query.enabled=true \
  --set storegateway.enabled=true \
  --set compactor.enabled=true \
  --set ruler.enabled=false
 
 
 

확인

 
kubectl get pods -n monitoring | grep thanos

 

 

 

 


🧩 6️⃣ Thanos Query 연결 확인

 
kubectl port-forward -n monitoring svc/thanos-query 9091:9090

 http://localhost:9091

Store 연결 확인

Status → Stores → Prometheus sidecar 보여야 함

 

 

 


🧩 7️⃣ Grafana → Thanos Query 연결

Grafana → Data Source → Prometheus 추가

URL:

기존 Prometheus 대신 Thanos로 변경 → 과거 6개월 GPU 사용량 조회 가능

 

 

 


🧩 8️⃣ 정상 업로드 확인

 
kubectl logs -n monitoring -l app.kubernetes.io/name=thanos-sidecar
 
 
uploading new block to S3

보이면 성공 🎯

 

 

 


🎯 지금 이 구성이 의미하는 것

이제 NCP GPU 클러스터는:

기능 구현
실시간 GPU 모니터링 Prometheus
알람 Alertmanager
1년치 GPU 사용 이력 Thanos + Object Storage
GPU 비용 감사 Thanos
장애 원인 추적 Thanos

 GPUaaS급 플랫폼 완성

 

 

 


🚀 다음에 하면 되는 것

이제 가능:

  • GPU 사용자별 월간 사용량
  • 팀별 GPU 비용
  • 장애 발생 시 과거 시점 분석
  • GPU Idle 비용 낭비 추적

 

 

 

반응형

댓글