Prianshu-git/Kube911

GitHub: Prianshu-git/Kube911

基于 n8n 工作流引擎的 Kubernetes 全自动事件响应流水线,实现从告警捕获、Issue 创建、多渠道通知到 ArgoCD 回滚的一体化闭环处置。

Stars: 0 | Forks: 0

Kube-911 Logo
# 🔥 Kube-911:Kubernetes 事件响应机器人 由 n8n 驱动的全自动事件响应流水线。 当 pod 崩溃、节点宕机或 deployment 失败时,Kube-911 会自动: - 🚨 **捕获** Prometheus Alertmanager webhook - 📝 **创建** 包含完整上下文与日志的 GitHub issue - 💬 **通过** Slack、Discord 或 WhatsApp 向您的团队发送告警 - 🔄 **触发** ArgoCD 回滚(可选,需审批) [![演示](https://img.shields.io/badge/▶-Watch%20Demo-red)](./docs/DEMO.md) [![n8n](https://img.shields.io/badge/n8n-Workflow-orange)](./n8n-workflows/) [![K8s](https://img.shields.io/badge/Kubernetes-1.28%2B-blue)](./k8s/) ## 🎯 您将构建的内容 ``` ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌─────────────┐ │ Pod Crash │────▶│ Alertmanager │────▶│ n8n │────▶│ GitHub Issue│ │ Node Down │ │ Webhook │ │ Workflow │ │ + Labels │ └─────────────┘ └──────────────┘ └──────┬──────┘ └─────────────┘ │ ┌────────────────────────┼────────────────────────┐ ▼ ▼ ▼ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Slack Alert │ │ Discord │ │ WhatsApp │ │ + Buttons │ │ Notification│ │ Notification│ └─────────────┘ └─────────────┘ └─────────────┘ │ ▼ ┌─────────────┐ │ ArgoCD │ │ Rollback │ │ (Approved) │ └─────────────┘ ``` # 架构
Kube-911 Architecture
## 请求流程图
Kube-911 Request flow
## 🚀 快速开始 (5 分钟) ### 前置条件 - Kubernetes 集群 (kind, minikube, EKS, GKE, AKS) - Helm 3 - n8n 实例 (云托管或自托管) - (可选) GitHub, Slack, Discord, WhatsApp 账号 ### 1. 部署演示集群 ``` # 克隆并进入 git clone https://github.com/kubesimplify/kube911.git cd kube911 # 部署 Prometheus + Alertmanager + Demo apps kubectl apply -k k8s/ # 验证一切正在运行 kubectl get pods -n monitoring kubectl get pods -n demo-apps ``` ### 2. 配置您的集成 ``` # 复制配置模板 cp config/config.example.yaml config/config.yaml # 使用你的凭据进行编辑 nano config/config.yaml ``` ### 3. 导入 n8n 工作流 ``` # 在你的 n8n 实例中,前往 Workflows → Import # 上传: n8n-workflows/kube911-main-workflow.json ``` ### 4. 触发测试事件 ``` # 使一个 pod 崩溃并见证奇迹 kubectl delete pod -n demo-apps -l app=flaky-api ``` ## 📁 仓库结构 ``` kube911/ ├── 📄 README.md # You're here ├── 📁 k8s/ # Kubernetes manifests │ ├── monitoring/ # Prometheus + Alertmanager │ ├── demo-apps/ # Intentionally failing apps │ └── rbac/ # ServiceAccounts & permissions ├── 📁 n8n-workflows/ # Importable n8n workflows │ ├── kube911-main-workflow.json # Main incident response │ └── kube911-rollback-bot.json # ArgoCD rollback handler ├── 📁 config/ # Configuration templates │ ├── config.example.yaml # All integrations │ └── n8n-credentials.md # How to get each credential ├── 📁 scripts/ # Helper scripts │ ├── setup.sh # One-command setup │ ├── test-incident.sh # Trigger demo incidents │ └── verify.sh # Verify your setup ├── 📁 docs/ # Deep documentation │ ├── SETUP.md # Detailed setup guide │ ├── DEMO.md # Demo script & talking points │ ├── ARCHITECTURE.md # How it all works │ ├── CUSTOMIZE.md # Add your own integrations │ └── TROUBLESHOOTING.md # Common issues └── 📄 LICENSE ``` ## 🎛️ 集成开关系统 每个集成都是**可选的**,并且可以通过配置进行**切换**: | 集成 | 开关键 | 所需用途 | |-------------|-----------|--------------| | GitHub Issues | `github.enabled` | 创建 Issue,回滚 PR | | Slack | `slack.enabled` | 实时告警,审批按钮 | | Discord | `discord.enabled` | 替代聊天通知 | | WhatsApp | `whatsapp.enabled` | 通过 n8n WhatsApp 节点进行移动端告警 | | ArgoCD | `argocd.enabled` | 自动回滚 | **示例:** 只需要 Slack + GitHub?将其他所有选项设置为 `false` 即可。 ## 📜 许可证 MIT — 为 KubeSimplify 社区用 ❤️ 构建。
标签:Alertmanager, ArgoCD, Bot, Discord, Incident Response, Issue管理, n8n, Slack, SRE, Webhook, WhatsApp, 偏差过滤, 力导向图, 告警分发, 告警管理, 回滚, 子域名突变, 容器编排, 工作流自动化, 持续部署, 故障自愈, 机器人, 自动化运维, 自定义请求头, 运维自动化