k8s-mig-manager
v0.1.2
Published
Ink + Bun + TypeScript CLI for viewing and changing NVIDIA GPU Operator MIG profiles on Kubernetes nodes.
Readme
k8s-mig-manager
Ink + Bun + TypeScript CLI for viewing and changing NVIDIA GPU Operator MIG profiles on Kubernetes nodes.
Install
The package is published to npmjs.org. Install globally with npm:
npm install -g k8s-mig-managerOr install globally with Bun:
bun add -g k8s-mig-managerUsage
After installation, run the CLI directly:
k8s-mig-managerDevelopment
Install dependencies and run locally:
bun install
bun run startLint and format:
bun run lint
bun run lint:fix
bun run format
bun run check:fixThese scripts call bunx --bun @biomejs/[email protected], so they can run even when the Biome binary is not installed globally.
Controls
- outer layer:
up/downselect a node,enteropens a GPU node - node layer:
left/rightswitches between Profiles and Metrics tabs - Profiles tab:
up/downselect a MIG profile,enterstages it,enteragain applies it - Profiles tab shows the selected profile detail beside the profile list on wide terminals, and below it on narrow terminals
- Profiles tab:
leftgoes back to the node list r: refresh nowq/ctrl+c: quit
The CLI only enables profile actions for nodes that advertise nvidia.com/gpu.present=true or nvidia.com/gpu resources. Non-GPU nodes are rendered dim and skipped during selection.
How Changes Work
NVIDIA GPU Operator MIG manager watches this node label:
nvidia.com/mig.config=<profile>Applying a profile is equivalent to:
kubectl label node <node> nvidia.com/mig.config=<profile> --overwriteAvailable profiles are read from the per-node MIG manager ConfigMap first, such as gpu-operator/<node>-mig-config. If that is not available, the CLI falls back to profiles implied by node resources like nvidia.com/mig-1g.12gb.
Real-time GPU usage is read from DCGM exporter through the Kubernetes service proxy:
kubectl get --raw /api/v1/namespaces/gpu-operator/services/nvidia-dcgm-exporter:9400/proxy/metrics