Kind · metal.platform-kit.org/v1alpha1
HostClaim
A HostClaim takes one machine for your use. It names the machine by its Asset, and it can name the TalosNode to install. You write it. Keep claims in git, so that a person examines each change.
At a glance
Section titled “At a glance”- Group and version
metal.platform-kit.org/v1alpha1- Scope
- Namespace. Claims are usually in
default. - Written by
- You. The operator writes the status.
- Reconciled by
- HostClaim controller
- Binds
- One Host. Only one claim can hold a Host.
- Phases
- Pending, Bound, Ambiguous.
- Finalizer
metal.platform-kit.org/releasekeeps a deleted claim until the operator frees the machine.- Source
- hostclaim_types.go
What a claim does to a machine
Section titled “What a claim does to a machine”- With
spec.os - The operator proposes an install of the TalosNode. After the approval, the install erases the install disk.
- Without
spec.os - The claim only reserves the machine. The operator does nothing to it.
- When you delete it
- The operator releases the machine. If the operator installed the machine, it stops the machine. A machine that the claim did not install continues to run.
How it connects
Section titled “How it connects”The HostClaim controller follows spec.assetRef to the Asset, then to its ManagementEndpoint, then to the Host.
It writes the claim into spec.claimRef of the Host. The first claim that writes this field holds the Host.
For each change to the machine, the controller proposes a HostOperation. Read Approval. Use pk-metal status to see the claims and the operations that wait, and pk-metal approve to approve an operation. Rack to running node shows the full path, and Release and reuse shows the release.
Lifecycle
Section titled “Lifecycle”- You apply the claim. The phase is Pending.
- The controller finds the Host of the Asset and binds it. The phase is Bound, and the Host is Assigned.
- If the claim has
spec.os, the controller proposes the install operation. The conditionProvisionedis False and gives the cause of the wait. - You approve the operation. The operator installs the machine.
- The node reports to the operator. The controller writes
status.handOff, andProvisionedis True. - You delete the claim. The controller proposes the release operation. The Host goes to Releasing and, after the release, to Available.
The operator installs a machine only one time for each claim. The record in status.handOff tells the operator that the work is complete.
If the node stops later, the operator does not install it again.
| Phase | Meaning | The operator shows it when | Rule |
|---|---|---|---|
Pending | The claim holds no Host. If blockedOn is empty, the operator waits for the machine to appear. | Bound is absent, or False with a reason that is not AmbiguousSystem. | 3 |
Bound | The claim holds one Host. If an install waits for a person, blockedOn gives the reason. | Bound is True. | 1 |
Ambiguous | The BMC manages more than one machine, and the claim does not name one. The operator does not select one for you. | Bound is False with the reason AmbiguousSystem. | 2 |
Type ClaimPhase in HostClaimStatus.phase ·hostclaim_types.go
The Host has a different set of phases. Read Host.
| Field | Type | Description |
|---|---|---|
assetRefrequired | object | AssetRef names the Asset whose machine this claim binds. |
namerequired | string | The name of the object. |
labels | map[string]string | Labels are copied onto the bound Host and removed when the claim goes away, for example role: worker. EndpointProfiles and firmware plans select machines by them. Keys have no prefix (no "/"), so they never clash with the labels the operator sets under metal.platform-kit.org/.
|
os | object | OS names the TalosNode the machine should run. Setting it proposes an install that erases the disk chosen by the TalosNode's installDiskSelector. Without it the claim only reserves the machine and nothing is done to it.
|
nodeRefrequired | object | NodeRef names the TalosNode (os.platform-kit.org) whose config the machine boots. |
namerequired | string | The name of the object. |
provisioning | object | Provisioning tunes how the operator installs the OS onto the machine. |
approval | string | Approval: Required (default) or Automatic.RequiredAutomatic |
systemRef | object | SystemRef picks one machine by its Redfish system id when the BMC manages more than one (a multi-node chassis). Leave it out when the BMC manages one machine. |
namerequired | string | The name of the object. |
Rules of the spec
Section titled “Rules of the spec”- A change of
spec.assetReforspec.systemRefmoves the claim to another machine. The operator releases the old machine first, then binds the new one. Only a member of the admin group can do this. Use pk-metal replace. - You cannot change
spec.os.nodeRef. To change the node, removespec.os. Then set it again. - A key in
spec.labelshas no prefix and no/. A claim can have 16 labels at most. spec.provisioning.approvalisRequiredorAutomatic. The default isRequired.
Status
Section titled “Status”| Field | Type | Description |
|---|---|---|
blockedOn | string | BlockedOn says why the claim does not continue. Before the bind, it tells why the claim cannot bind (AssetNotFound, AssetNotMaterialized, HostAlreadyClaimed). After the bind, it tells why the install waits (Approval(Provisioning), HeldByUser, HostInMaintenance, OperationFailed). kubectl describe shows the message with the command to run. |
conditions | []object | Conditions are the truth — the only thing reconcilers branch on. |
handOff | object | HandOff records that the machine was installed: which host runs which TalosNode, from which config, since when. The operator writes it one time, when the boot finishes. This record tells the operator that the work is done. A node that is down later is not installed again. A deletion of old HostOperations changes nothing. It goes away with the claim. |
atrequired | string (date-time) | At is when the operator saw the hand-off. |
configDigest | string | ConfigDigest is sha256:<hex> of the rendered config the machine booted with; empty when the record was rebuilt from an operation that did not carry it. |
hostrequired | string | Host is the Host the node was installed on. |
noderequired | string | Node is the TalosNode the machine runs. |
operation | string | Operation is the boot operation (namespace/name) that installed the machine. Empty when the machine already ran the node when the claim found it: the operator never touched it, so a release leaves its power alone. |
hostRef | object | HostRef names the bound Host. |
namerequired | string | The name of the object. |
phase | string | Phase summarizes the conditions below for people and for kubectl columns. It is a summary, not the contract: automation should read conditions.PendingBoundAmbiguous |
Columns of kubectl get hostclaims (the columns marked wide show only with -o wide):
| Column | Value |
|---|---|
NAME | .metadata.name |
ASSET | .spec.assetRef.name |
HOST | .status.hostRef.name |
NODE | .spec.os.nodeRef.name |
PHASE | .status.phase |
PROVISIONED | .status.conditions[?(@.type=="Provisioned")].reason |
BLOCKEDwide | .status.blockedOn |
AGE | .metadata.creationTimestamp |
Conditions
Section titled “Conditions”| Condition | True means | Effect on the phase |
|---|---|---|
Bound |
The claim holds its Host. | Bound when True |
Provisioned |
The machine runs the configuration of the TalosNode. Absent when the claim holds no Host. | None. A reason that needs a person shows in blockedOn. |
Why a claim waits
Section titled “Why a claim waits”The column BLOCKED of kubectl get hostclaims -o wide shows status.blockedOn.
blockedOn |
Meaning | What to do |
|---|---|---|
AssetNotFound |
No Asset has the name in spec.assetRef. |
Write the Asset, or correct the name. |
AssetNotMaterialized |
The Asset has no endpoint. | Read the condition Materialized of the Asset. |
HostAlreadyClaimed |
A different claim holds the Host. | Delete that claim, or use a different machine. |
AmbiguousSystem |
The BMC manages more than one machine. | Make a new claim with spec.systemRef. |
SystemNotFound |
The BMC has no system with the name in spec.systemRef. |
Correct spec.systemRef in a new claim. |
Approval(Provisioning) |
The install operation waits for approval. The condition Provisioned has the reason AwaitingApproval and the command to run. |
pk-metal approve |
Replacing |
You moved the claim to a different machine. The operator removes the node from the old machine first. | Approve the release of the old machine. See pk-metal replace. |
HeldByUser |
The claim has the hold annotation. | pk-metal unhold |
HostInMaintenance |
The Host has the maintenance annotation. | Put a host in maintenance |
SelfDisruption |
The install would stop the machine that the operator runs on, or a control plane of its own cluster. | Self-protection |
SingleMediumUnsupported |
The BMC holds one medium, and an installer with the config inside cannot help. | One-slot BMC |
NoBootableMedia |
The BMC shows no media slot that can mount an image, or no boot target for it. | Media slot busy or missing |
OperationFailed |
The install operation failed. | Operation failed |
ReleaseFailed |
The release operation failed. The machine stays bound. | Operation failed |
An empty blockedOn on a Pending claim means that the machine did not appear yet. The operator waits.
A claim that waits for approval
Section titled “A claim that waits for approval”The claim, its Host and the operation show the same wait.
| Object | What it shows while the install waits for approval |
|---|---|
| HostClaim | Phase Bound, Provisioned=False with the reason AwaitingApproval, and blockedOn: Approval(Provisioning) |
| Host | Phase Assigned, and blockedOn: Approval(Provisioning) |
| HostOperation | Phase AwaitingApproval |
kubectl -n default get hostclaim node-2 -o widepk-metal status shows the same in one table.
Annotations
Section titled “Annotations”| Annotation | Effect | Set it with |
|---|---|---|
metal.platform-kit.org/hold |
The operator proposes nothing for the claim. It removes the proposals that have no approval. | pk-metal hold |
metal.platform-kit.org/reinstall |
The operator proposes a wipe and a new install on the same machine. | pk-metal reinstall |
metal.platform-kit.org/ack-etcd-risk |
You accept the risk for etcd when a control plane goes. | --ack-etcd-risk |
Labels, annotations and finalizers has the full text of each key.
Example
Section titled “Example”apiVersion: metal.platform-kit.org/v1alpha1kind: HostClaimmetadata: name: node-1 namespace: defaultspec: assetRef: name: asset-07 labels: role: worker os: nodeRef: name: node-1 provisioning: approval: Required$ kubectl get hostclaimsNAME ASSET HOST NODE PHASE PROVISIONED AGEnode-1 asset-07 simhw2288v5000397 node-1 Bound HandedOff 3dnode-2 asset-08 simhw2288v5000398 node-2 Bound AwaitingApproval 4mStop the proposals for a claim
Section titled “Stop the proposals for a claim”Use a hold when you want the operator to wait, for example before a change window.
-
Set the hold. Give the reason.
Terminal window pk-metal hold --reason "wait for the change window" default/node-2 -
Make sure that the claim shows the hold.
Terminal window kubectl get hostclaims -o wide -
Do your work.
-
Remove the hold.
Terminal window pk-metal unhold default/node-2
A hold does not stop an operation that has an approval and runs.