Skip to content

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.

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/release keeps a deleted claim until the operator frees the machine.
Source
hostclaim_types.go
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.
A HostClaim names an Asset and a TalosNode. The operator binds the Host of the Asset to the claim and proposes HostOperations for it.HostClaimAssetHostTalosNodeHostOperationspec.assetRefbindsspec.os.nodeRefinstall, releaseThe operator proposes eachoperation. You approve it.
A HostClaim and the objects around it. You write the filled boxes.

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.

HostClaim phases. A claim is Pending until it binds one Host. It is Ambiguous when the BMC manages more than one machine and the claim names none.Pendingno HostBoundone HostAmbiguoustwo or more systemsBound is TrueAmbiguousSystemThe install starts whenthe claim has spec.os.Make a new claimwith spec.systemRef.
HostClaim phases. The phase tells you how many machines the claim found.
  1. You apply the claim. The phase is Pending.
  2. The controller finds the Host of the Asset and binds it. The phase is Bound, and the Host is Assigned.
  3. If the claim has spec.os, the controller proposes the install operation. The condition Provisioned is False and gives the cause of the wait.
  4. You approve the operation. The operator installs the machine.
  5. The node reports to the operator. The controller writes status.handOff, and Provisioned is True.
  6. 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.

PhaseMeaningThe operator shows it whenRule
PendingThe 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
BoundThe claim holds one Host. If an install waits for a person, blockedOn gives the reason.Bound is True.1
AmbiguousThe 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.

FieldTypeDescription
assetRefrequiredobjectAssetRef names the Asset whose machine this claim binds.
namerequiredstringThe name of the object.
labelsmap[string]stringLabels 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/.Bounds: at most 16 entriesPattern: ^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$
  • Rule: label keys must be unprefixed valid label names
osobjectOS 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.
  • Rule: os.nodeRef is immutable: drop the OS intent first, or create another claim
nodeRefrequiredobjectNodeRef names the TalosNode (os.platform-kit.org) whose config the machine boots.
namerequiredstringThe name of the object.
provisioningobjectProvisioning tunes how the operator installs the OS onto the machine.
approvalstringApproval: Required (default) or Automatic.RequiredAutomaticDefault: Required
systemRefobjectSystemRef 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.
namerequiredstringThe name of the object.
  • A change of spec.assetRef or spec.systemRef moves 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, remove spec.os. Then set it again.
  • A key in spec.labels has no prefix and no /. A claim can have 16 labels at most.
  • spec.provisioning.approval is Required or Automatic. The default is Required.
FieldTypeDescription
blockedOnstringBlockedOn 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[]objectConditions are the truth — the only thing reconcilers branch on.
handOffobjectHandOff 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.
atrequiredstring (date-time)At is when the operator saw the hand-off.
configDigeststringConfigDigest 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.
hostrequiredstringHost is the Host the node was installed on.
noderequiredstringNode is the TalosNode the machine runs.
operationstringOperation 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.
hostRefobjectHostRef names the bound Host.
namerequiredstringThe name of the object.
phasestringPhase 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):

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

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.

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
Terminal window
kubectl -n default get hostclaim node-2 -o wide

pk-metal status shows the same in one table.

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.

apiVersion: metal.platform-kit.org/v1alpha1
kind: HostClaim
metadata:
name: node-1
namespace: default
spec:
assetRef:
name: asset-07
labels:
role: worker
os:
nodeRef:
name: node-1
provisioning:
approval: Required
Terminal window
$ kubectl get hostclaims
NAME ASSET HOST NODE PHASE PROVISIONED AGE
node-1 asset-07 simhw2288v5000397 node-1 Bound HandedOff 3d
node-2 asset-08 simhw2288v5000398 node-2 Bound AwaitingApproval 4m

Use a hold when you want the operator to wait, for example before a change window.

  1. Set the hold. Give the reason.

    Terminal window
    pk-metal hold --reason "wait for the change window" default/node-2
  2. Make sure that the claim shows the hold.

    Terminal window
    kubectl get hostclaims -o wide
  3. Do your work.

  4. Remove the hold.

    Terminal window
    pk-metal unhold default/node-2

A hold does not stop an operation that has an approval and runs.