|
1 | 1 | --- |
2 | 2 | sidebar_position: 1 |
| 3 | +title: HolmesGPT 介绍 |
3 | 4 | --- |
4 | 5 |
|
5 | | -# Intro |
| 6 | +# HolmesGPT 介绍 |
| 7 | + |
| 8 | +## HolmesGPT 是什么 |
| 9 | + |
| 10 | +**HolmesGPT** 是一个面向云原生环境的智能故障排查助手(AI Agent for Troubleshooting Cloud-Native Environments)。 |
| 11 | +它基于大语言模型(LLM),通过交互式分析、自动化集成和多源数据联动,帮助用户快速定位和解决云原生系统中的问题。 |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## 主要特性 |
| 16 | + |
| 17 | +### 1. 交互式诊断(Interactive Mode) |
| 18 | + |
| 19 | +HolmesGPT 提供强大的对话式交互界面,支持用户以自然语言与 AI 进行多轮对话式排障。 |
| 20 | +它能够理解上下文,结合日志、事件、配置等信息,进行迭代式的故障分析与建议。 |
| 21 | + |
| 22 | +### 2. CI/CD 流水线故障分析 |
| 23 | + |
| 24 | +HolmesGPT 可集成到 CI/CD 流水线中,自动识别并分析部署失败的原因。 |
| 25 | +当部署失败时,系统会即时生成诊断结果,并可将分析报告推送到 **Slack** 等协作工具中,帮助开发团队快速响应。 |
| 26 | + |
| 27 | +### 3. Prometheus 告警分析 |
| 28 | + |
| 29 | +通过连接到 **AlertManager** 实例,HolmesGPT 能够对 Prometheus/AlertManager 的告警进行深入分析。 |
| 30 | +无论是全量告警还是特定告警,都可通过 HolmesGPT 发起智能调查,定位潜在问题根因。 |
| 31 | + |
| 32 | +### 4. MCP 集成分析 |
| 33 | + |
| 34 | +HolmesGPT 支持与 **MCP(Model Context Protocol)** 服务器集成,可结合 **MCP** 与 **自定义 tool_call** 进行智能化排查,帮助运维人员快速理解和解决集群异常。 |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## 快速开始 |
| 39 | + |
| 40 | +### 前提条件 |
| 41 | + |
| 42 | +在开始之前,请确保: |
| 43 | + |
| 44 | +- 已部署可用的 **KubeSphere** 环境。 |
| 45 | +- 已按照 [AI Labs 快速开始指南](https://frezes.github.io/ai-labs/docs/quick-start/) 安装完成 AI Labs 平台。 |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +### 安装 HolmesGPT 扩展 |
| 50 | + |
| 51 | +1. 打开 **KubeSphere 扩展中心**。 |
| 52 | +2. 搜索 **HolmesGPT** 并进入详情页。 |
| 53 | +3. 点击 **安装**,根据提示完成安装流程。 |
| 54 | + |
| 55 | +#### 示例配置 |
| 56 | + |
| 57 | +```yaml |
| 58 | +holmes: |
| 59 | + logLevel: DEBUG |
| 60 | + additionalEnvVars: |
| 61 | + - name: CLUSTER_NAME |
| 62 | + value: "host" |
| 63 | + - name: DEEPSEEK_API_BASE |
| 64 | + value: "https://openapi.coreshub.cn/v1" # 请替换为您的 DeepSeek API Base |
| 65 | + - name: DEEPSEEK_API_KEY |
| 66 | + value: "sk-*******************" # 请替换为您的 DeepSeek API Key |
| 67 | + |
| 68 | + customClusterRoleRules: |
| 69 | + - apiGroups: ["monitoring.coreos.com"] |
| 70 | + resources: ["servicemonitors", "podmonitors", "prometheusrules"] |
| 71 | + verbs: ["get", "list"] |
| 72 | + - apiGroups: [""] |
| 73 | + resources: ["secrets", "pods", "services", "configmaps", "persistentvolumeclaims"] |
| 74 | + verbs: ["get", "list", "watch"] |
| 75 | + - apiGroups: [""] |
| 76 | + resources: ["namespaces"] |
| 77 | + verbs: ["get"] |
| 78 | + - apiGroups: ["apps"] |
| 79 | + resources: ["deployments", "statefulsets", "daemonsets"] |
| 80 | + verbs: ["get", "list", "watch"] |
| 81 | + - apiGroups: ["batch"] |
| 82 | + resources: ["jobs", "cronjobs"] |
| 83 | + verbs: ["get", "list", "watch"] |
| 84 | + - apiGroups: ["networking.k8s.io"] |
| 85 | + resources: ["ingresses"] |
| 86 | + verbs: ["get", "list", "watch"] |
| 87 | + |
| 88 | + toolsets: |
| 89 | + kubernetes/core: |
| 90 | + enabled: true |
| 91 | + kubernetes/logs: |
| 92 | + enabled: true |
| 93 | + kubernetes/prometheus_stack: |
| 94 | + description: This toolset fetches Prometheus target definitions. Requires specific cluster role rules. |
| 95 | + enabled: true |
| 96 | + helm/core: |
| 97 | + enabled: true |
| 98 | + robusta: |
| 99 | + enabled: false |
| 100 | + internet: |
| 101 | + enabled: true |
| 102 | + prometheus/metrics: |
| 103 | + enabled: true |
| 104 | + config: |
| 105 | + prometheus_url: "http://prometheus-k8s.kubesphere-monitoring-system.svc:9090" |
| 106 | + |
| 107 | + modelList: |
| 108 | + deepseek: |
| 109 | + api_key: "{{ env.DEEPSEEK_API_KEY }}" |
| 110 | + model: deepseek/DeepSeek-V3.1-Terminus # 请替换为您的 DeepSeek 模型 |
| 111 | + temperature: 0 |
| 112 | +``` |
| 113 | +
|
| 114 | +安装完成后,HolmesGPT 将出现在扩展组件列表中,可直接进入交互模式进行使用。 |
| 115 | +
|
| 116 | +> 💡 **提示:** |
| 117 | +> 模型原则上支持多种,可查看[配置部分](./configuration.md)了解详情。国内推建使用 **DeepSeek-V3.1-Terminus** 模型。 |
| 118 | +> 可使用基石智算的产品,[注册](https://www.coreshub.cn/) 即送算力券,参考如下方式[获取 API Key](https://docs.coreshub.cn/console/big_model_server/api_key/create_api_key),使用 **DeepSeek-V3.1-Terminus** 模型。 |
| 119 | +
|
| 120 | +
|
| 121 | +
|
| 122 | +## 下一步 |
| 123 | +
|
| 124 | +* [使用 HolmesGPT 进行交互式排障](./playground.md) |
| 125 | +* [配置 HolmesGPT](./configuration.md) |
| 126 | +* [更多关于 HolmesGPT 的信息](https://holmesgpt.dev/) |
| 127 | +
|
0 commit comments