llm-wiki wiki · sources 2026-06-14

原文:raw/headlamp-architecture-analysis.md · 仓库:https://github.com/kubernetes-sigs/headlamp · 优先级 P1

一句话定位

Headlamp 是可扩展 Kubernetes web UI,面向 dashboard、debugging、monitoring 和插件扩展。

核心架构图

┌────────────────────────────────────────────────────────────────────────────┐
│ Kubernetes UI need                                                         │
│ Users need browsing, debugging, monitoring, and plugin-driven cluster      │
│ operations.                                                                │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Headlamp frontend                                                          │
│ React UI renders resources, logs, events, plugin views, and navigation.    │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Backend/proxy and auth                                                     │
│ Kubeconfig, tokens, access checks, and API proxying connect the UI to      │
│ clusters.                                                                  │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Runtime boundary                                                           │
│ Kubernetes API resources and extensions become an operator-facing web      │
│ experience.                                                                │
└────────────────────────────────────────────────────────────────────────────┘

模块分层

层 / 模块 职责
Frontend React/TypeScript UI
Backend/proxy Kubernetes API access
Plugin system UI and cluster extensions
Auth/context kubeconfig, in-cluster, OIDC-like deployments

关键数据流

用户打开 Headlamp
        │
        ▼
选择 cluster/context
        │
        ▼
后端代理 Kubernetes API
        │
        ▼
前端展示 workloads/events/logs/resources
        │
        ▼
插件扩展额外视图或动作

设计决策与哲学