HAMi 平台版在线部署手册
本文档面向 SRE / 平台工程师,介绍如何在 Kubernetes 集群上部署 HAMi AI Platform,并完成与 HAMi、Prometheus、NVIDIA GPU Operator、Gateway 等基础组件的对接和功能验证。
⚠️ 安装 ≠ 激活
完成本节的 Helm Charts 安装后,HAMi AI Platform的组件会运行,但 HAMi AI Platform底层的 GPU 虚拟化与调度功能需要激活证书后才能正常使用。
安装过程本身不依赖证书,您可以先完成部署,再通过后续步骤申请并导入证书。
简而言之:先装软件,后拿证书;不激活则 vGPU 切分与调度功能不可用,验证也会失败。
前置条件清单
| 类型 | 要求 | 验证命令 |
|---|---|---|
| Kubernetes | ≥ 1.24 | kubectl version --short |
| 容器运行时 | containerd 或 Docker | kubectl get nodes -o wide |
| Helm | ≥ 3.14 | helm version --short |
| GPU 驱动 | NVIDIA driver ≥ 470(推荐 ≥ 550) | nvidia-smi |
| Prometheus CRD | 必须安装 Prometheus monitoring CRD 以兼容不同的监控指标采集系统:Prometheus, VictoriaMetrics, etc. | kubectl api-resources | grep monitoring.coreos.com/v1 |
| GPU Operator | 已安装且 devicePlugin.enabled = false,推荐版本:v25.3.2) | helm list -A | grep gpu-operator |
| 存储空间 | 建议大于 30 GB | df -h |
关键约束:HAMi 自带 device-plugin,与 NVIDIA GPU Operator 内置 device-plugin 冲突。若已安装 GPU Operator,务必通过--set devicePlugin.enabled=false 禁用其内置 plugin。
相较于 HAMi,AI Platform 平台服务额外依赖了 Kuberentes Gateway API 作为默认的服务暴露方式(配合 envoy-gateway),如果您需要且集群里并没有 Gateway API(通过 kubectl api-resources | grep gateway.networking.k8s.io/v1检查),请先安装。
安装
两种安装路径,按场景选:
- 在线 OCI 安装(评估、PoC、可通外部网络的集群)
- All-in-One 离线一体包(金融/政府/运营商等隔离网络场景)
无论如何安装,最后都需要申请证书并激活。
路径 A:在线 Helm Charts 安装
如果希望使用国内镜像仓库,请联系 Dynamia.ai 的售前/技术支持获取相关信息。
推荐使用版本追踪系统维护集群中所有 Helm Chart releases 的 values 文件。 通过使用 -f example-values.yaml 覆盖 Charts 中默认 values 中与之相对应的 key。
选择好 kubeconfig context 后,开始操作:
如果没有安装过 nvidia/gpu-operator,先安装。
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia && helm repo update
helm install --wait --generate-name \
-n gpu-operator --create-namespace \
nvidia/gpu-operator \
--set devicePlugin.enabled=false \
--set dcgmExporter.serviceMonitor.enabled=true \
--version=v25.3.2
如果集群里没有 Prometheus 等监控栈,还需要安装,这里展示 prometheus-community/kube-prometheus-stack 的安装方法。
helm install prometheus \
oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack \
--version 72.3.0 \
--namespace monitoring \
--create-namespace \
--set alertmanager.enabled=false \
--set grafana.enabled=false
安装 dynamia-ai/hami-enterprise:
helm install hami \
oci://ghcr.io/dynamia-ai/charts/hami-enterprise \
--version 2.9.0-rc2 \
--namespace hami-system \
--create-namespace
hami-enterprise 常见 Chart 自定义选项如下表,完整 values 配置请见:HAMi Helm Chart Values Reference。
| 参数 | 说明 | 默认值 |
|---|---|---|
dra.enabled | 是否部署启用 DRA | false |
scheduler.leaderElect | 是否启用hami-scheduler的多节点选举 | true |
scheduler.replicas | 调整 hami-scheduler的实例数量 | 1 |
scheduler.kubeScheduler.image.registry | hami-scheduler所使用的kube-scheduler镜像仓库。 | "registry.cn-hangzhou.aliyuncs.com" |
scheduler.kubeScheduler.image.repository | hami-scheduler所使用的kube-scheduler镜像名称。 | "google_containers/kube-scheduler" |
scheduler.kubeScheduler.image.tag | hami-scheduler所使用的kube-scheduler镜像版本。如果不填,chart 会推算一个合适的版本。 | "" |
如果集群中没有 Gateway API 实现,安装 envoyproxy/envoy-gateway 用于暴露服务:
helm install eg \
oci://docker.io/envoyproxy/gateway-helm \
--version v1.6.2 \
--namespace envoy-gateway-system \
--create-namespace \
--set global.images.envoyGateway.image=docker.io/envoyproxy/gateway:v1.6.2 \
--set global.image.ratelimit.image=docker.io/envoyproxy/ratelimit:99d85510 \
--set config.envoyGateway.gateway.controllerName=gateway.envoyproxy.io/gatewayclass-controller \
--set config.envoyGateway.provider.type=Kubernetes
安装 dynamia-ai/kantaloupe (AI Platform 平台服务,下称 kantaloupe):
helm install kantaloupe \
oci://ghcr.io/dynamia-ai/kantaloupe/kantaloupe-chart \
--version 0.17.6 \
--namespace kantaloupe-system \
--create-namespace \
--set fullnameOverride=kantaloupe
kantaloupe 由于需要配置功能特性、服务暴露、监控指标采集等功能,配置项较多,请按需配置,完整 values 配置请见 kantaloupe Helm Chart Value Reference。
常见的配置 values 示例如下,你可以拼接多段示例构成完整values文件:
- 配置默认平台管理员信息
auth:
jwtSecret: "your-own-jwt-secret"
bootstrapAdminUsername: "bootstrap-platform-admin"
bootstrapAdminPassword: "admin12345"
bootstrapAdminFullName: "Platform Administrator"
bootstrapAdminEmail: "admin@email.com"
- 使用 envoy-gateway NodePort 暴露服务,在集群外部使用LoadBalancer(云厂商负载均衡、自建负载均衡等)转发四层流量。
gateway:
enabled: true
hostnames:
- your-domain.example.com
apiserverCors:
enabled: true
allowCredentials: true
allowOrigins:
- https://your-domain.example.com
envoy:
service:
ports:
http:
nodePort: 30080
https:
nodePort: 30443
type: NodePort
listeners:
- name: http
port: 80
protocol: HTTP
- name: https
port: 443
protocol: HTTPS
tls:
certificateRef:
name: your-domain-tls-secret
redirectFromHttp: true
- 使用 envoy-gateway NodePort 暴露服务,简单 PoC
gateway:
enabled: true
listeners:
- name: http
port: 80
protocol: HTTP
envoy:
service:
type: NodePort
ports:
http:
nodePort: 30080
- 使用云厂商或裸金属服务提供的负载均衡 controller 接手的 LoadBalancer service
gateway:
enabled: true
hostnames:
- your.domain
listeners:
- name: http
port: 80
protocol: HTTP
- name: https
port: 443
protocol: HTTPS
tls:
certificateRef:
name: your-tls-secret
redirectFromHttp: true
envoy:
service:
type: LoadBalancer
ports:
http: {}
https: {}
- 不使用 Gateway API,自行处理服务暴露。
gateway:
enabled: false
- 替换 prometheus Query API addr(默认为
http://prometheus-kube-prometheus-prometheus.monitoring.svc.cluster.local:9090)
apiserver:
prometheusAddr: http://your-prometheus-query-api.com:9090
controllerManager:
prometheusAddr: http://your-prometheus-query-api.com:9090
路径 B:All-in-One 离线一体包
请联系 Dynamia.ai 的售前/技术支持伙伴获取下载地址和操作手册。
启用 GPU 节点
HAMi device-plugin 仅在带 gpu=on 标签(可以通过)的节点上启动:
kubectl label nodes <node-name> gpu=on
验证:kubectl -n hami-system get pods 应能看到 hami-device-plugin-*、hami-scheduler-* 处于 Running 状态。
监控对接
确保集群里的监控指标系统(kube-prometheus-stack Prometheus,VictoriaMetrics vmagent 等)能采集 HAMi 与 DCGM-Exporter 指标。
如果使用 Prometheus, ServiceMonitor 资源的 metadata.labels 必须与 Prometheus 资源的 spec.serviceMonitorSelector 字段匹配,否则 Prometheus不会采集这些指标。
如果使用 VictoriaMetrics,ServiceMonitor 资源的 metadata.labels必须与 VMServiceScrape 资源的 spec.serviceScrapeSelector 字段匹配,否则 vmagent 不会采集这些指标。
验证指标采集
| Exporter | 查询指标 | 预期 |
|---|---|---|
dcgm-exporter | DCGM_FI_DEV_GPU_UTIL | 返回非空值 |
hami-exporter | HostCoreUtilization | 返回非空值 |
hami-device-plugin-exporter | GPUDeviceCoreAllocated | 返回非空值 |
除了 exporter 的指标,还需要查询 kantaloupe_gpu_temp 验证 kantaloupe 服务指标是否被正确采集。
证书获取
请完成上述安装任务,确保所有组件的 Pod 都正常启动后再开始激活流程。
- 使用
平台管理员账号登录 HAMi AI Platform。 - 进入 License 与系统信息 页面
- 按照页面提示获取授权申请信息。
- 将授权申请信息发送给密瓜智能销售或交付人员。
- 根据指引完成激活。
激活后验证
# 1. Pod 状态
kubectl -n hami-system get pods
# 2. Device Plugin 注册的 GPU 资源
kubectl describe node <gpu-node> | grep -A 5 'Capacity:'
# 期望看到:nvidia.com/gpu: <N> 以及 nvidia.com/gpumem: <MB>
# 3. 提交一个测试 Pod 验证调度
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: hami-smoke
spec:
restartPolicy: Never
containers:
- name: cuda
image: nvidia/cuda:12.4.0-base-ubuntu22.04
command: ["nvidia-smi"]
resources:
limits:
nvidia.com/gpu: 1
nvidia.com/gpumem: 2000
EOF
kubectl logs hami-smoke
期望:nvidia-smi 输出可见 GPU 信息,且显存被限制为 2000 MiB。
HAMi AI Platform验证
# 1. Pod 状态
kubectl -n kantaloupe-system get pods
# 2. 服务可达
kubectl -n kantaloupe-system get svc
HAMi AI Platform 服务暴露后,打开站点,确认前后端正常工作。
创建工作负载
在控制台 工作负载 页面,创建应用(如 gpu-burn):

创建完成后,确认以下验证项均通过:
- 创建成功,控制台无报错
- 负载列表:应用状态、检索、列表指标与监控面板(GPU SM / GPU MEM / CPU / Memory)正常,时间切换与图表符合预期

- 应用详情:基础信息、资源总览、与监控数据正常;从详情页跳转 GPU / 节点页面,资源总览与监控数据正常


常见问题
| 现象 | 可能原因 | 处理 |
|---|---|---|
| 镜像拉不下来 | Node 没有外部网络或者与 ghcr.io 连接不畅。 | 联系 Dynamia.ai 的售前/技术支持获取国内镜像仓库地址或 All-in-One 离线一体包。 |
hami-device-plugin Pod Pending 或者不存在 | 节点未打 gpu=on 标签 | kubectl label nodes <node> gpu=on |
hami-device-plugin Pod CrashLoopBackOff | 与 NVIDIA 默认 device-plugin 冲突 | 禁用 GPU Operator 的 devicePlugin(--set devicePlugin.enabled=false)。 |
| 查不到 HAMi 指标 | Prometheus 资源的serviceMonitorSelector 与 ServiceMonitor 资源中的 label 不匹配 | 对齐 prometheus/prometheus-kube-prometheus-prometheus 的 spec.serviceMonitorSelector 和 hami-enterprise 的 serviceMonitor labels。 |
nvidia-smi 报错 | GPU 驱动未就绪 | 检查 gpu-operator namespace 下 driver Pod 状态。 |
示例 workload Pending | 证书未激活、GPU 不足或节点标签缺失 | 检查证书、GPU 节点标签和 kubectl describe pod 事件 |
Gateway 没有入口地址 | Envoy Gateway 未就绪或 Service 类型不适配集群 | 检查 envoy-gateway-system Service 和 Gateway 状态 |
获取支持
- 邮箱:info@dynamia.ai
- 售前 / 技术支持:400-026-7800
- 已签订商业合同的客户请通过专属支持渠道提交 Issue