-
Notifications
You must be signed in to change notification settings - Fork 146
metal3: Add BareMetalHost plugin with list and detail views #852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mastermaxx03
wants to merge
4
commits into
headlamp-k8s:main
Choose a base branch
from
mastermaxx03:metal3-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
612d82b
metal3: Scaffold the plugin
mastermaxx03 3d1f23f
metal3: Add composite Status column with tests
mastermaxx03 ef589e7
metal3: Add BareMetalHost list and detail views with a CRD guard
mastermaxx03 db44806
metal3: Register sidebar entry and routes
mastermaxx03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| node_modules | ||
| .vscode | ||
| dist | ||
| .eslintcache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Metal3 Headlamp Plugin | ||
|
|
||
| A [Headlamp](https://headlamp.dev) plugin that adds a Metal3 section to the UI for viewing | ||
| bare-metal infrastructure through Kubernetes. | ||
|
|
||
| [Metal3](https://metal3.io) manages bare-metal hosts as Kubernetes resources. This plugin surfaces | ||
| those resources in Headlamp with list and detail views, so operators can inspect their bare-metal | ||
| estate without dropping to `kubectl`. | ||
|
|
||
| > Status: early / in progress. See [Current scope](#current-scope) and [Limitations](#limitations). | ||
|
|
||
| ## Current scope | ||
|
|
||
| - **BareMetalHost** | ||
| - List view with a composite **Status** column that combines the host's operational status | ||
| (the headline signal), its provisioning state, and any error type into a single cell. A host | ||
| that is provisioned but in error is therefore shown as both at once, which a single-value | ||
| column cannot do. | ||
| - Detail view with configuration, status, consumer, power state, and BMC fields. | ||
| - Graceful handling when the Metal3 CRDs are not installed in the connected cluster: the views | ||
| show an explanatory message instead of an empty or erroring screen. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [Headlamp](https://headlamp.dev) (desktop app or in-cluster). | ||
| - A Kubernetes cluster whose API has the Metal3 `baremetal-operator` CRDs installed, in | ||
| particular `baremetalhosts.metal3.io`. If those CRDs are absent, the plugin indicates that the | ||
| operator is not installed rather than showing an empty view. To stand up Metal3 and provision a | ||
| host, see the Metal3 [Try it](https://book.metal3.io/developer_environment/tryit) getting-started | ||
| guide. | ||
|
|
||
| ## Limitations | ||
|
|
||
| - Read-only for now: no mutating actions (power on/off, reboot, detach) yet. | ||
| - Only the BareMetalHost resource is implemented. The cluster-api-provider-metal3 resources | ||
| (Metal3Machine, Metal3Cluster, and the rest), the resource-relationship map, and mutating | ||
| actions are planned. | ||
|
|
||
| ## Development | ||
|
|
||
| Install dependencies and start a watch build: | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm start | ||
| ``` | ||
|
|
||
| Then run Headlamp (the desktop app or a build from source) pointed at a cluster that has the | ||
| Metal3 CRDs; the plugin's "Metal3" entry appears in the sidebar. | ||
|
|
||
| A sample BareMetalHost manifest for local testing is in | ||
| [`test-files/baremetalhost.yaml`](./test-files/baremetalhost.yaml): | ||
|
|
||
| ```bash | ||
| kubectl apply -f test-files/baremetalhost.yaml | ||
| ``` | ||
|
|
||
| Other useful commands: | ||
|
|
||
| ```bash | ||
| npm run build # production build to dist/ | ||
| npm run tsc # type-check | ||
| npm test # unit tests (vitest) | ||
| npm run lint # lint | ||
| ``` | ||
|
|
||
| For general Headlamp plugin development, see the | ||
| [plugin documentation](https://headlamp.dev/docs/latest/development/plugins/). | ||
|
|
||
| ## License | ||
|
|
||
| Apache License 2.0. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to add a link to the metal3 getting started page.