Skip to content

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.

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
You write an Asset and a Secret. The operator finds the address of the BMC in the ledger, makes a ManagementEndpoint, reads the BMC, and makes a Host.Assetserial, bmcMacLedgerMAC to addressManagementEndpointsame nameHostnamed by serialbmcMacaddresssystemsSecretusername, passwordBMCRedfishcredentialsRefreadsThe operator compares theserial and the MAC addresswith the Asset.
From an Asset to a Host. The operator makes the two objects on the right.

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.

An Asset has no phase. It has one condition.

  1. You apply the Asset. Materialized is absent.
  2. The controller finds the MAC address in the ledger and makes the endpoint. Materialized is True, with the name and the address of the endpoint.
  3. If the controller cannot make the endpoint, Materialized is False. The reason tells you what to correct.
  4. 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.

FieldTypeDescription
bmcMacstringBMCMac 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.Bounds: at most 17 characters
  • Rule: bmcMac must be a MAC address such as 0c:c4:7a:12:34:56 (upper case and '-' separators are fine)
cidrequiredstringCID is your asset tag or CMDB id for the machine; any unique string.Bounds: at least 1 characters
credentialsRefrequiredobjectCredentialsRef 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.
namestringThe name of the object.Default:
serialrequiredstringSerial 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.Bounds: at least 1 characters
vlanintegerVLAN is the management network the BMC is on. It is used only to pick matching EndpointProfiles; the operator does not configure any network.Bounds: 1 to 4094
FieldTypeDescription
conditions[]objectConditions: 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):

ColumnValue
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
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.

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/v1alpha1
kind: Asset
metadata:
name: asset-07
spec:
cid: "ASSET-07"
serial: "SIMHW2288V5000397"
bmcMac: "02:00:48:0b:74:83"
vlan: 100
credentialsRef:
name: ibmc-factory
---
apiVersion: v1
kind: Secret
metadata:
name: ibmc-factory
namespace: pk-metal
stringData:
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]
  1. Apply the Asset.

    Terminal window
    kubectl apply -f asset.yaml
  2. Read the column ENDPOINT. It shows the reason of Materialized.

    Terminal window
    $ kubectl get assets
    NAME CID SERIAL BMC MAC ENDPOINT AGE
    asset-07 ASSET-07 SIMHW2288V5000397 02:00:48:0b:74:83 EndpointMaterialized 2m
    asset-08 ASSET-08 SIMHW2288V5000398 02:00:48:0b:74:84 NoLedgerEntry 2m
  3. If the reason is not EndpointMaterialized, read the message.

    Terminal window
    kubectl describe asset asset-08
  4. Correct the Asset or the ledger. Then do step 2 again.