tencent cloud

容器服务

动态与公告
产品动态
公告
产品发布记录
产品简介
产品概述
产品优势
产品架构
应用场景
产品功能
基本概念
原生 Kubernetes 名词对照
容器服务高危操作
地域和可用区
开源组件
购买指南
购买指引
购买 TKE 标准集群
购买原生节点
购买超级节点
快速入门
新手指引
快速创建一个标准集群
入门示例
容器应用部署 Check List
集群配置
标准集群概述
集群管理
网络管理
存储管理
节点管理
GPU 资源管理
远程终端
应用配置
工作负载管理
服务和配置管理
组件和应用管理
弹性伸缩
容器登录方式
可观测配置
运维可观测性
成本洞察和优化
调度配置
调度组件概述
资源利用率优化调度
业务优先级保障调度
Qos 感知调度
安全和稳定性
容器服务安全组设置
身份验证和授权
应用安全
多集群管理
计划升级
备份中心
云原生服务指南
云原生 etcd
Prometheus 监控服务
TKE Serverless 集群指南
TKE 注册集群指南
实践教程
集群
Serverless 集群
调度
安全
服务部署
网络
发布
日志
监控
运维
Terraform
DevOps
弹性伸缩
容器化
微服务
成本管理
混合云
AI
故障处理
节点磁盘爆满排障处理
节点高负载排障处理
节点内存碎片化排障处理
集群 DNS 解析异常排障处理
集群 Kube-Proxy 异常排障处理
集群 API Server 网络无法访问排障处理
Service&Ingress 网络无法访问排障处理
Service&Ingress 常见报错和处理
Nginx Ingress 偶现 Connection Refused
CLB Ingress 创建报错排障处理
Pod 网络无法访问排查处理
Pod 状态异常与处理措施
授权腾讯云售后运维排障
CLB 回环问题
API 文档
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
常见问题
TKE 标准集群
TKE Serverless 集群
运维类
隐患处理
服务类
镜像仓库类
远程终端类
事件类
资源管理类
服务协议
TKE Service Level Agreement
TKE Serverless Service Level Agreement
联系我们
词汇表

GPU 监控指标获取

PDF
聚焦模式
字号
最后更新时间: 2024-12-25 15:00:37

组件介绍

TKE 开发了 elastic-gpu-exporter 组件,用于获取 GPU 相关的监控指标。主要包含以下内容:
GPU 卡利用率
Pod / 容器 GPU 资源利用率

部署方式

elastic-gpu-exporter 通过 DaemonSet 的方式部署到集群中。
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: elastic-gpu-exporter
namespace: kube-system
labels:
app: elastic-gpu-exporter
spec:
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
name: gpu-manager-ds
app: nano-gpu-exporter
template:
metadata:
name: elastic-gpu-exporter
labels:
name: gpu-manager-ds
app: nano-gpu-exporter
spec:
nodeSelector:
qgpu-device-enable: enable
serviceAccount: elastic-gpu-exporter
hostNetwork: true
hostPID: true
hostIPC: true
containers:
- image: ccr.ccs.tencentyun.com/tkeimages/elastic-gpu-exporter:v1.0.8
imagePullPolicy: Always
args:
- --node=$(NODE_NAME)
env:
- name: "PORT"
value: "5678"
- name: "NODE_NAME"
valueFrom:
fieldRef:
fieldPath: spec.nodeName
name: elastic-gpu-exporter
securityContext:
capabilities:
add: ["SYS_ADMIN"]
volumeMounts:
- name: cgroup
readOnly: true
mountPath: "/host/sys"
volumes:
- name: cgroup
hostPath:
type: Directory
path: "/sys"
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: elastic-gpu-exporter
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- update
- patch
- get
- list
- watch
- apiGroups:
- ""
resources:
- bindings
- pods/binding
verbs:
- create
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: elastic-gpu-exporter
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: elastic-gpu-exporter
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: elastic-gpu-exporter
subjects:
- kind: ServiceAccount
name: elastic-gpu-exporter
namespace: kube-system
---
apiVersion: v1
kind: Service
metadata:
name: elastic-gpu-exporter
namespace: kube-system
annotations:
prometheus.io/scrape: "true"
labels:
kubernetes.io/cluster-service: "true"
spec:
clusterIP: None
ports:
- name: elastic-gpu-exporter
port: 5678
protocol: TCP
targetPort: 5678
selector:
app: nano-gpu-exporter


查看运行状态

部署后,集群中生成一个 elastic-gpu-exporter 的 DaemonSet:
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
elastic-gpu-exporter 1 1 1 1 1 <none> 3m36s
符合条件的节点上会有一个运行的 elastic-gpu-exporter 的 Pod:
NAME READY STATUS RESTARTS AGE
elastic-gpu-exporter-dblqm 1/1 Running 0 6s

获取监控指标

elastic-gpu-exporter 的服务运行所在节点会输出到 /metrics 路径下,因此也可以通过如下命令获取监控指标:
$ curl NodeIP:5678/metrics

GPU 卡相关指标

gpu_xxx
GPU 指标
gpu_core_usage
GPU 实际使用的算力
gpu_mem_usage
GPU 实际使用的显存
gpu_core_utilization_percentage
GPU 算力使用率
gpu_mem_utilization_percentage
GPU 显存使用率
GPU 卡的指标形式为: 
gpu_core_usage{card="0",node="10.0.66.4"} 0
说明:
“card” 表示 GPU 的序号,“node” 表示所在节点。

Pod 相关指标

pod_xxx
pod 指标
pod_core_usage
pod 实际使用的算力
pod_mem_usage
pod 实际使用的显存
pod_core_utilization_percentage
pod 实际使用的算力占申请算力的百分比
pod_mem_utilization_percentage
pod 实际使用的显存占申请显存的百分比
pod_core_occupy_node_percentage
pod 实际使用的算力占节点总算力百分比
pod_mem_occupy_node_percentage
pod 实际使用的显存占节点总显存百分比
pod_core_request
pod 申请的算力
pod_mem_request
pod 申请的显存
Pod 的指标形式为: 
pod_core_usage{namespace="default",node="10.0.66.4",pod="7a2fa737-eef1-4801-8937-493d7efb16b7"} 0
说明:
“namespace” 表示 Pod 所在的 namespace,“node” 表示 Pod 所在节点,“pod” 表示 Pod 的名称。

容器相关指标

container_xxx
容器指标
container_gpu_utilization
容器实际使用的算力
container_gpu_memory_total
容器实际使用的显存
container_core_utilization_percentage
容器实际使用的算力占申请算力的百分比
container_mem_utilization_percentage
容器实际使用的显存占申请显存的百分比
container_request_gpu_memory
容器申请的显存
container_request_gpu_utilization
容器申请的算力
容器的指标形式为: 
container_gpu_utilization{container="cuda",namespace="default",node="10.0.66.4",pod="cuda"} 0
说明:
“container” 表示容器名称,“namespace” 表示容器所在的 namespace,“node” 表示容器所在节点,“pod” 表示容器所在的 Pod 的名称。


帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈