Kind · metal.platform-kit.org/v1alpha1
Asset
An Asset is one physical machine as your records know it: its serial number and the MAC address of its BMC. You write one Asset for each machine. The operator does nothing with a machine until an Asset names it.
At a glance
Section titled “At a glance”- Group and version
metal.platform-kit.org/v1alpha1- Scope
- Cluster. An Asset has no namespace.
- Written by
- You, by hand or from an export of your inventory. Keep it in git.
- Reconciled by
- Asset controller
- Name
- Your choice. The ManagementEndpoint gets the same name.
- Owns
- One ManagementEndpoint. When you delete the Asset, Kubernetes deletes the endpoint.
- Phases
- None. Read the condition
Materialized. - Source
- asset_types.go
How it connects
Section titled “How it connects”The Asset controller looks for spec.bmcMac in the ledger. The ledger gives the address of the BMC.
With the address, the controller makes the ManagementEndpoint. Through the BMC, the operator finds the machine and makes a Host.
A HostClaim names the Asset to get that Host.
The Asset holds only what you know. The other two kinds hold what the operator found. Assert and observe explains this rule. The operator compares the two sets of facts. If they do not agree, it stops. Read Identity.
Lifecycle
Section titled “Lifecycle”An Asset has no phase. It has one condition.
- You apply the Asset.
Materializedis absent. - The controller finds the MAC address in the ledger and makes the endpoint.
Materializedis True, with the name and the address of the endpoint. - If the controller cannot make the endpoint,
Materializedis False. The reason tells you what to correct. - When you change the Asset, the controller writes the endpoint again. The endpoint compares the new values with the BMC.
The ManagementEndpoint and the Host keep a copy of the Asset spec that they used last. If the Asset is absent for a short time, the operator continues with that copy.
| Field | Type | Description |
|---|---|---|
bmcMac | string | BMCMac is the MAC address of the BMC's own network port, as printed on the label or shown by `ipmitool lan print`. Either case, with ':' or '-' between the bytes. The operator looks it up in the ledger to find the BMC's address, and checks that the BMC at that address reports it.
|
cidrequired | string | CID is your asset tag or CMDB id for the machine; any unique string. |
credentialsRefrequired | object | CredentialsRef names a Secret in the operator's namespace with the BMC's login (keys username and password), usually the factory default. An EndpointProfile can later move the BMC to a managed account; this login then stays as the way back in. |
name | string | The name of the object. |
serialrequired | string | Serial is the machine's serial number as your records have it: the chassis or board serial on the label. The operator compares it with the serial the BMC reports, and does nothing to the machine if they differ. |
vlan | integer | VLAN is the management network the BMC is on. It is used only to pick matching EndpointProfiles; the operator does not configure any network. |
Status
Section titled “Status”| Field | Type | Description |
|---|---|---|
conditions | []object | Conditions: Materialized. True names the endpoint; False says what is missing (NoBMCMac, NoLedgerEntry, LedgerEntryInvalid, MaterializeConflict) and how to fix it. |
Columns of kubectl get assets (the columns marked wide show only with -o wide):
| Column | Value |
|---|---|
NAME | .metadata.name |
CID | .spec.cid |
SERIAL | .spec.serial |
BMC MAC | .spec.bmcMac |
ENDPOINT | .status.conditions[?(@.type=="Materialized")].reason |
VLANwide | .spec.vlan |
AGE | .metadata.creationTimestamp |
Conditions
Section titled “Conditions”| Condition | Reason | Meaning | What to do |
|---|---|---|---|
Materialized True |
EndpointMaterialized |
The ManagementEndpoint exists. The message gives its address. | Nothing. |
Materialized False |
NoBMCMac |
The Asset has no spec.bmcMac. |
Set spec.bmcMac. |
Materialized False |
NoLedgerEntry |
The MAC address is not in the ledger. | Add the line to the ledger, or correct the MAC address. |
Materialized False |
LedgerEntryInvalid |
The ledger has the MAC address, but the operator cannot read the line. | Correct the line. The message gives the cause. |
Materialized False |
MaterializeConflict |
An endpoint with this name is the property of a different Asset. | Give the Asset a different name. |
The operator also sends a warning event when the reason changes. Conditions and reasons lists all reasons.
Example
Section titled “Example”An Asset, and the Secret with the login of the BMC. The Secret must be in the namespace of the operator, pk-metal.
apiVersion: metal.platform-kit.org/v1alpha1kind: Assetmetadata: name: asset-07spec: cid: "ASSET-07" serial: "SIMHW2288V5000397" bmcMac: "02:00:48:0b:74:83" vlan: 100 credentialsRef: name: ibmc-factory---apiVersion: v1kind: Secretmetadata: name: ibmc-factory namespace: pk-metalstringData: username: Administrator password: <the factory password>The ledger must have a line for the MAC address:
"02:00:48:0b:74:83": https://[2001:db8:0:100::14]Make sure that an Asset has its endpoint
Section titled “Make sure that an Asset has its endpoint”-
Apply the Asset.
Terminal window kubectl apply -f asset.yaml -
Read the column ENDPOINT. It shows the reason of
Materialized.Terminal window $ kubectl get assetsNAME CID SERIAL BMC MAC ENDPOINT AGEasset-07 ASSET-07 SIMHW2288V5000397 02:00:48:0b:74:83 EndpointMaterialized 2masset-08 ASSET-08 SIMHW2288V5000398 02:00:48:0b:74:84 NoLedgerEntry 2m -
If the reason is not
EndpointMaterialized, read the message.Terminal window kubectl describe asset asset-08 -
Correct the Asset or the ledger. Then do step 2 again.