6cd159b5a4cebec35fa5cfcce0443ca46259baab
* test: add component test coverage for all untested files Adds 60 new tests (108 total) covering every untested module: - IntelGpuDataContext: provider renders, loading/loaded states, CRD available/unavailable paths, refresh, useIntelGpuContext throws outside provider - OverviewPage: loading, plugin-not-detected, error, populated, refresh button, CRD notice, device plugin table, plugin daemon pods, active pods - NodesPage: loading, empty state, GPU node summary table, detail cards - PodsPage: loading, empty state, summary counts, pending pod attention, all-pods table - DevicePluginsPage: loading, CRD unavailable, no-plugins, plugin detail, daemon pod table - NodeDetailSection: null for non-GPU nodes, GPU capacity/allocatable rows, pod list, loading state - PodDetailSection: null for non-GPU pods, GPU resource rows, phase status, limits-only containers - MetricsPage: context loading gate, Prometheus unreachable, empty chips, chip cards with power values, MetricRequirements always rendered, refresh Also fixes vitest.config.mts to pin NODE_ENV=test so tests run correctly without requiring callers to set it explicitly. Co-Authored-By: Paperclip <noreply@paperclip.ing> * fix: remove unused act import and merge duplicate metrics imports in MetricsPage.test.tsx Co-Authored-By: Paperclip <noreply@paperclip.ing> * fix: cast useList mock return values to any in IntelGpuDataContext.test.tsx The Headlamp useList() return type is an intersection of a tuple and QueryListResponse, which plain array literals like [[], null] and [null, null] do not satisfy. Cast all useList mockReturnValue arguments to any so tsc passes without requiring full KubeObject stub objects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * style: run Prettier formatting and ESLint lint:fix on test files Addresses CI format:check failures and import-sort warning in MetricsPage.test.tsx flagged by QA on PR #17. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Hugh Hackman <hugh@privilegedescalation.com> Co-authored-by: Paperclip <noreply@paperclip.ing> Co-authored-by: Gandalf the Greybeard <gandalf@privilegedescalation.com> Co-authored-by: Gandalf the Greybeard <gandalf@privilegedescalation.dev> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Gandalf the Greybeard <gandalf-the-greybeard[bot]@users.noreply.github.com>
headlamp-intel-gpu-plugin
A Headlamp plugin providing visibility into Intel GPU device plugin deployments on Kubernetes.
Features
- Overview Dashboard — Plugin health, GPU node summary, allocation bar, active GPU pods
- Device Plugins — GpuDevicePlugin CRD instances with spec/status and daemon pod health
- GPU Nodes — Per-node GPU type (discrete/integrated), device count, allocation, workload pods
- GPU Pods — All pods requesting Intel GPU resources with per-container detail
- Metrics — Real-time GPU power draw (W) and TDP via Prometheus node-exporter i915 hwmon
- Node Detail Integration — Intel GPU section injected into native Headlamp Node detail views
- Pod Detail Integration — GPU resource requests/limits injected into native Pod detail views
- Nodes Table Columns — GPU Type and GPU Devices columns added to native Nodes table
Installation
Search for headlamp-intel-gpu in the Headlamp Plugin Manager (Settings → Plugins → Catalog).
Requirements
- Headlamp >= v0.20.0
- Intel GPU device plugin deployed (optional — plugin gracefully degrades without it)
- Optional: Node Feature Discovery with Intel GPU labels
- Optional: kube-prometheus-stack with node-exporter for GPU power metrics
RBAC
This plugin is read-only and requires the following permissions:
| Resource | API Group | Verbs |
|---|---|---|
| nodes | v1 | list, get, watch |
| pods | v1 | list, get, watch |
| gpudeviceplugins | deviceplugin.intel.com/v1 | list, get |
For metrics, Prometheus must be accessible via the Headlamp API proxy in the monitoring namespace.
Architecture
src/
├── index.tsx # Plugin entry point
├── api/
│ ├── k8s.ts # Types and helper functions
│ ├── metrics.ts # Prometheus GPU metrics
│ └── IntelGpuDataContext.tsx # React context provider
└── components/
├── OverviewPage.tsx # Dashboard
├── DevicePluginsPage.tsx # Device plugin CRDs
├── NodesPage.tsx # GPU nodes
├── PodsPage.tsx # GPU pods
├── MetricsPage.tsx # Power metrics
├── NodeDetailSection.tsx # Injected into Node detail view
├── PodDetailSection.tsx # Injected into Pod detail view
└── integrations/
└── NodeColumns.tsx # Nodes table columns
Development
npm install
npm start # dev server
npm test # run tests
npm run tsc # type check
npm run lint # ESLint
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| No GPU nodes shown | No Intel GPU labels or resources on nodes | Install Intel Node Feature Discovery or Intel GPU device plugin |
| CRD not available warning | GpuDevicePlugin CRD not installed | Install Intel device plugins operator — plugin still works without it |
| No metrics data | Prometheus not found | Deploy kube-prometheus-stack in the monitoring namespace |
| Metrics show only discrete GPUs | Integrated GPUs lack hwmon | Expected — iGPU driver doesn't expose hwmon power data |
Contributing
See CONTRIBUTING.md for development guidelines.
License
Apache License 2.0. See LICENSE for details.
Description
Headlamp plugin for Intel GPU device visibility and resource monitoring in Kubernetes
Readme
1.6 MiB