headlamp-metallb-plugin
May 28, 2026 ยท View on GitHub
This repository contains a Headlamp plugin for managing MetalLB resources.
The plugin currently supports key MetalLB resources and adds dedicated list and details pages inside Headlamp.
What the plugin provides
- A dedicated MetalLB sidebar section.
- A table view for
IPAddressPool,L2Advertisement, andBGPAdvertisementresources with resource-specific columns. - A table view for
BGPPeerresources with resource-specific columns. - A details page for each supported resource showing key spec fields (and status fields where available).
- YAML helpers and patch builders for supported resources, with validation that prevents changing
metadata.nameandmetadata.namespaceduring edits.
Supported MetalLB resources
This plugin supports:
IPAddressPool(metallb.io/v1beta1, namespaced)L2Advertisement(metallb.io/v1beta1, namespaced)BGPAdvertisement(metallb.io/v1beta1, namespaced)BGPPeer(metallb.io/v1beta1, namespaced)
Other MetalLB resources can be added later following the same pattern used in src/resources/ and src/components/.
Routes and navigation
IPAddressPoollist route:/metallb/ipaddresspoolsIPAddressPooldetails route:/metallb/ipaddresspools/:namespace/:nameL2Advertisementlist route:/metallb/l2advertisementsL2Advertisementdetails route:/metallb/l2advertisements/:namespace/:nameBGPAdvertisementlist route:/metallb/bgpadvertisementsBGPAdvertisementdetails route:/metallb/bgpadvertisements/:namespace/:nameBGPPeerlist route:/metallb/bgppeersBGPPeerdetails route:/metallb/bgppeers/:namespace/:name
Development
Please refer to the Headlamp plugin development guide for general plugin development instructions.
Install dependencies:
npm install
Useful scripts:
npm start- start plugin dev mode (watch)npm run build- production buildnpm run tsc- type-check TypeScriptnpm run lint- lint checksnpm run lint-fix- auto-fix lint issuesnpm run format- format codenpm run test- run testsnpm run storybook- run Storybooknpm run storybook-build- build Storybooknpm run i18n- extract i18n stringsnpm run package- create plugin tarball
Typical local workflow:
- Run
npm start. - Make changes in
src/. - Run
npm run tscandnpm run lint. - Run
npm run test. - Run
npm run buildbefore packaging/release.
Project structure
src/index.tsx- plugin registration (sidebar entries and routes)src/resources/ipAddressPool.ts-IPAddressPoolresource class and typessrc/resources/l2Advertisement.ts-L2Advertisementresource class and typessrc/resources/bgpAdvertisement.ts-BGPAdvertisementresource class and typessrc/resources/bgpPeer.ts-BGPPeerresource class and typessrc/components/ipAddressPools/List.tsx- list viewsrc/components/ipAddressPools/Detail.tsx- details viewsrc/components/l2Advertisements/List.tsx- list viewsrc/components/l2Advertisements/Detail.tsx- details viewsrc/components/bgpAdvertisements/List.tsx- list viewsrc/components/bgpAdvertisements/Detail.tsx- details viewsrc/components/bgpPeers/List.tsx- list viewsrc/components/bgpPeers/Detail.tsx- details viewsrc/utils/ipAddressPool.ts- YAML template and patch building helperssrc/utils/ipAddressPool.test.ts- tests for utility logicsrc/utils/l2Advertisement.ts- YAML template and patch building helperssrc/utils/l2Advertisement.test.ts- tests for utility logicsrc/utils/bgpAdvertisement.ts- YAML template and patch building helperssrc/utils/bgpAdvertisement.test.ts- tests for utility logicsrc/utils/bgpPeer.ts- YAML template and patch building helperssrc/utils/bgpPeer.test.ts- tests for utility logic
Contributing
Contributions are welcome. For changes:
- Keep scope focused and follow existing TypeScript patterns.
- Add or update tests where logic changes.
- Run
npm run tsc,npm run lint, andnpm run testbefore opening a PR.