HAMi 的部署与使用

0. 提前准备

需先在 K8s 集群内安装好 Nvidia GPU-Operator,确认集群内可以分配到显卡资源。

1. Helm 部署 HAMi

1.1 添加并拉取 HAMi Helm 仓库

1
2
3
helm repo add hami https://hamischeduler.github.io/helm-charts
helm repo update
helm pull hami-charts/hami --untar

本次安装无需修改 values.yaml 内容,如有需要请自行修改。

1.2 部署 HAMi

1
helm install hami . --namespace hami --create-namespace

等待安装完成

1.3 给 GPU 节点添加标签

检查 DaemonSet 中的 hami-device-plugin 发现其 nodeSelector 指定为gpu='on',因此需要给 GPU 节点添加标签。

1
kubectl label node <GPU_NODE_NAME> gpu=on

2. Helm 部署 HAMi-WebUI

2.1 添加并拉取 HAMi-WebUI Helm 仓库

1
2
3
helm repo add hami-webui https://project-hami.github.io/HAMi-WebUI
helm repo update
helm pull hami-webui/hami-webui --untar

2.2 修改 values 参数

以下为根据个人需求修改的部分参数,未列出的部分使用默认值。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 启用 ingress
ingress:
enabled: true
className: "kubesphere-router-cluster"
annotations: {}
# kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
hosts:
- host: hami.ks1.talang.team
paths:
- path: /
pathType: ImplementationSpecific
tls: []
- secretName: hami-tls
hosts:
- hami.ks1.talang.team

# 禁用内置 dcgm (已由GPU-Operator 提供)
dcgm:
enabled: false

# 连接已有的 Prometheus
externalPrometheus:
enabled: true
# If externalPrometheus.enabled is true, this address will be used
# address: "http://prometheus-kube-prometheus-prometheus.prometheus.svc.cluster.local:9090"
address: "prometheus-k8s.kubesphere-monitoring-system.svc.cluster.local:9090"

2.3 部署 HAMi-WebUI

1
helm install hami-webui . --namespace hami

HAMi 的部署与使用
https://heeteve-blog.pages.dev/2025/04/HAMi的部署与使用/
作者
Heeteve
发布于
2025年4月8日
许可协议