v1alpha1

package
v0.0.0-...-2e6cce1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the bootc v1alpha1 API group. +kubebuilder:object:generate=true +groupName=node.bootc.dev

Index

Constants

View Source
const (
	// NodeIdle reports whether the daemon has an active update cycle.
	// It does not claim whether the node is "up to date" — that is
	// determined by the controller by comparing spec.desiredImage
	// against status.booted.imageDigest.
	NodeIdle string = "Idle"

	// NodeDegraded indicates that the daemon has encountered an error.
	// The reason and message provide details about the specific error.
	NodeDegraded string = "Degraded"
)

Node condition types.

View Source
const (
	// NodeReasonIdle means the daemon has no active update cycle.
	NodeReasonIdle string = "Idle"

	// NodeReasonStaging means the daemon is pulling/staging an image.
	NodeReasonStaging string = "Staging"

	// NodeReasonStaged means the image is staged and locked, awaiting
	// desiredImageState: Booted to proceed with reboot.
	NodeReasonStaged string = "Staged"

	// NodeReasonRebooting means a reboot is in progress.
	NodeReasonRebooting string = "Rebooting"
)

NodeIdle condition reasons.

View Source
const (
	// NodeReasonError is a catch-all reason for daemon errors. The
	// condition message provides details about the specific error.
	NodeReasonError string = "Error"

	// NodeReasonHealthy means no errors.
	NodeReasonHealthy string = "Healthy"
)

NodeDegraded condition reasons.

View Source
const (
	// PoolUpToDate indicates whether all nodes in the pool are running
	// the target image digest.
	PoolUpToDate string = "UpToDate"

	// PoolDegraded indicates whether the pool has encountered an error
	// that may require attention.
	PoolDegraded string = "Degraded"
)

Pool condition types.

View Source
const (
	// PoolAllUpdated means all nodes are running the target digest.
	PoolAllUpdated string = "AllUpdated"

	// PoolRolloutInProgress means nodes are actively being updated.
	PoolRolloutInProgress string = "RolloutInProgress"

	// PoolPaused means updates are pending but the pool is paused.
	PoolPaused string = "Paused"
)

PoolUpToDate condition reasons.

View Source
const (
	// PoolNodeConflict means a node's labels match multiple pool selectors.
	PoolNodeConflict string = "NodeConflict"

	// PoolNodeDegraded means one or more nodes have encountered errors
	// or are not converging. The condition message identifies the
	// affected nodes and their issues.
	PoolNodeDegraded string = "NodeDegraded"

	// PoolRolloutHalted means the controller stopped assigning new
	// reboot slots because 2 or more nodes in reboot slots are
	// unhealthy (Degraded or not Ready).
	PoolRolloutHalted string = "RolloutHalted"

	// PoolInvalidSpec means the pool's spec contains invalid values that
	// the controller cannot process (e.g. an image ref that is not a
	// digest ref, or a malformed nodeSelector).
	PoolInvalidSpec string = "InvalidSpec"

	// PoolTagResolutionError means the controller failed
	// resolve the tag.
	PoolTagResolutionError string = "TagResolutionError"

	// PoolHealthy means no issues.
	PoolHealthy string = "Healthy"
)

PoolDegraded condition reasons. Precedence ordering (which reason takes priority when multiple apply) is defined by poolDegradedPrecedence in the controller package.

View Source
const (
	// LabelManaged is set on Nodes that are managed by a BootcNodePool.
	// Its presence triggers the DaemonSet to schedule a daemon pod on
	// the node.
	LabelManaged = "bootc.dev/managed"

	// AnnotationInRebootSlot is set on a BootcNode when the controller
	// assigns it a reboot slot (cordons the K8s Node and starts
	// draining). Cleared when the slot is freed (node is healthy and
	// Ready after reboot). Used for persistent slot counting across
	// controller restarts.
	AnnotationInRebootSlot = "bootc.dev/in-reboot-slot"

	// AnnotationWasCordoned is set on a BootcNode to record whether
	// the K8s Node was already cordoned before the controller cordoned
	// it for a reboot. Used to restore prior cordon state after update.
	AnnotationWasCordoned = "bootc.dev/was-cordoned"
)

Well-known labels and annotations applied to Nodes by the controller.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects.
	// This name is used by applyconfiguration generators (e.g. controller-gen).
	SchemeGroupVersion = schema.GroupVersion{Group: "node.bootc.dev", Version: "v1alpha1"}

	// GroupVersion is an alias for SchemeGroupVersion, for backward compatibility.
	GroupVersion = SchemeGroupVersion

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type BootcNode

type BootcNode struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is standard object metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state, written by the controller.
	// +required
	Spec BootcNodeSpec `json:"spec"`

	// status defines the observed state, written by the daemon.
	// +optional
	Status BootcNodeStatus `json:"status,omitzero"`
}

BootcNode represents a single node managed by the bootc operator. BootcNode objects are auto-created by the controller (one per managed node) and named after the Node they represent. The controller writes spec, the daemon writes status.

func (*BootcNode) DeepCopy

func (in *BootcNode) DeepCopy() *BootcNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNode.

func (*BootcNode) DeepCopyInto

func (in *BootcNode) DeepCopyInto(out *BootcNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BootcNode) DeepCopyObject

func (in *BootcNode) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BootcNodeList

type BootcNodeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []BootcNode `json:"items"`
}

BootcNodeList contains a list of BootcNode.

func (*BootcNodeList) DeepCopy

func (in *BootcNodeList) DeepCopy() *BootcNodeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodeList.

func (*BootcNodeList) DeepCopyInto

func (in *BootcNodeList) DeepCopyInto(out *BootcNodeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BootcNodeList) DeepCopyObject

func (in *BootcNodeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BootcNodePool

type BootcNodePool struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is standard object metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of the pool.
	// +required
	Spec BootcNodePoolSpec `json:"spec"`

	// status defines the observed state of the pool.
	// +optional
	Status BootcNodePoolStatus `json:"status,omitzero"`
}

BootcNodePool defines a group of nodes and their desired OS image state. Users create BootcNodePool resources to register nodes with the bootc operator and specify what image they should be running.

func (*BootcNodePool) DeepCopy

func (in *BootcNodePool) DeepCopy() *BootcNodePool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodePool.

func (*BootcNodePool) DeepCopyInto

func (in *BootcNodePool) DeepCopyInto(out *BootcNodePool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BootcNodePool) DeepCopyObject

func (in *BootcNodePool) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BootcNodePoolList

type BootcNodePoolList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []BootcNodePool `json:"items"`
}

BootcNodePoolList contains a list of BootcNodePool.

func (*BootcNodePoolList) DeepCopy

func (in *BootcNodePoolList) DeepCopy() *BootcNodePoolList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodePoolList.

func (*BootcNodePoolList) DeepCopyInto

func (in *BootcNodePoolList) DeepCopyInto(out *BootcNodePoolList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BootcNodePoolList) DeepCopyObject

func (in *BootcNodePoolList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BootcNodePoolSpec

type BootcNodePoolSpec struct {
	// nodeSelector selects which nodes belong to this pool. Each node can
	// belong to at most one pool; overlapping selectors cause the
	// conflicting pools to be marked Degraded with reason NodeConflict.
	// +required
	NodeSelector *metav1.LabelSelector `json:"nodeSelector"`

	// image defines the desired OS image for nodes in this pool.
	// +required
	Image ImageSpec `json:"image"`

	// rollout controls how updates are rolled out across pool nodes.
	// +optional
	Rollout *RolloutSpec `json:"rollout,omitempty"`

	// disruption controls the disruption behavior during updates.
	// +optional
	Disruption *DisruptionSpec `json:"disruption,omitempty"`

	// pullSecretRef references a Secret containing image pull credentials
	// for the OS image. The operator propagates this secret to managed nodes.
	// +optional
	PullSecretRef *PullSecretRef `json:"pullSecretRef,omitempty"`
}

BootcNodePoolSpec defines the desired state of a BootcNodePool.

func (*BootcNodePoolSpec) DeepCopy

func (in *BootcNodePoolSpec) DeepCopy() *BootcNodePoolSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodePoolSpec.

func (*BootcNodePoolSpec) DeepCopyInto

func (in *BootcNodePoolSpec) DeepCopyInto(out *BootcNodePoolSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BootcNodePoolStatus

type BootcNodePoolStatus struct {
	// observedGeneration is the most recent generation observed by the
	// controller. It corresponds to the pool's metadata.generation which
	// is updated on spec mutations.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// targetDigest is the image digest the pool is rolling out to. For
	// digest refs, this is set directly from spec.image.ref. For tag refs,
	// this is the resolved digest from the registry.
	// +optional
	TargetDigest string `json:"targetDigest,omitempty"`

	// nextTagResolutionTime is when the controller will next resolve a
	// tag ref to a digest. Only set for tag-based image refs.
	// +optional
	NextTagResolutionTime *metav1.Time `json:"nextTagResolutionTime,omitempty"`

	// deployedDigest is the last digest fully rolled out to all nodes in
	// the pool.
	// +optional
	DeployedDigest string `json:"deployedDigest,omitempty"`

	// updateAvailable is true when targetDigest differs from deployedDigest.
	// +optional
	UpdateAvailable bool `json:"updateAvailable,omitempty"`

	// nodeCount is the total number of nodes in this pool.
	// +optional
	NodeCount int32 `json:"nodeCount,omitempty"`

	// updatedCount is the number of nodes running the target digest.
	// +optional
	UpdatedCount int32 `json:"updatedCount,omitempty"`

	// updatingCount is the number of nodes actively being updated
	// (staging, staged, or rebooting).
	// +optional
	UpdatingCount int32 `json:"updatingCount,omitempty"`

	// degradedCount is the number of nodes in a degraded state.
	// +optional
	DegradedCount int32 `json:"degradedCount,omitempty"`

	// conditions represent the current state of the pool.
	// Known condition types are "UpToDate" and "Degraded".
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

BootcNodePoolStatus defines the observed state of a BootcNodePool.

func (*BootcNodePoolStatus) DeepCopy

func (in *BootcNodePoolStatus) DeepCopy() *BootcNodePoolStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodePoolStatus.

func (*BootcNodePoolStatus) DeepCopyInto

func (in *BootcNodePoolStatus) DeepCopyInto(out *BootcNodePoolStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BootcNodeSpec

type BootcNodeSpec struct {
	// desiredImage is the image the node should be running, specified
	// as a pullspec with digest (e.g.
	// "quay.io/example/myos@sha256:abc123"). Set by the controller
	// from the owning pool's targetDigest.
	// +required
	// +kubebuilder:validation:MinLength=1
	DesiredImage string `json:"desiredImage"`

	// desiredImageState is the target state the daemon should drive
	// the node toward. "Staged" means stage the image but do not
	// reboot. "Booted" means apply the staged image and reboot.
	// +required
	DesiredImageState DesiredImageState `json:"desiredImageState"`

	// pullSecretRef references a Secret containing image pull
	// credentials. Copied from the owning pool's spec.
	// +optional
	PullSecretRef *PullSecretRef `json:"pullSecretRef,omitempty"`

	// pullSecretHash is a hash of the pull secret's content, used to
	// detect changes. When this value changes, the daemon re-fetches
	// the secret and updates the host filesystem.
	// +optional
	PullSecretHash string `json:"pullSecretHash,omitempty"`
}

BootcNodeSpec defines the desired state of a BootcNode. Written by the controller; the daemon treats it as read-only.

func (*BootcNodeSpec) DeepCopy

func (in *BootcNodeSpec) DeepCopy() *BootcNodeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodeSpec.

func (*BootcNodeSpec) DeepCopyInto

func (in *BootcNodeSpec) DeepCopyInto(out *BootcNodeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BootcNodeStatus

type BootcNodeStatus struct {
	// observedGeneration is the most recent generation observed by the
	// daemon. It corresponds to the BootcNode's metadata.generation
	// which is updated on spec mutations.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// booted describes the currently booted OS image.
	// +optional
	Booted *ImageInfo `json:"booted,omitempty"`

	// staged describes the OS image staged for the next boot, if any.
	// +optional
	Staged *ImageInfo `json:"staged,omitempty"`

	// rollback describes the previous OS image available for rollback,
	// if any.
	// +optional
	Rollback *ImageInfo `json:"rollback,omitempty"`

	// conditions represent the daemon's current state.
	// Known condition types are "Idle" and "Degraded".
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

BootcNodeStatus defines the observed state of a BootcNode. Written by the daemon; the controller treats it as read-only.

func (*BootcNodeStatus) DeepCopy

func (in *BootcNodeStatus) DeepCopy() *BootcNodeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootcNodeStatus.

func (*BootcNodeStatus) DeepCopyInto

func (in *BootcNodeStatus) DeepCopyInto(out *BootcNodeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DesiredImageState

type DesiredImageState string

DesiredImageState describes the target state the daemon should drive the node toward for the desired image. +kubebuilder:validation:Enum=Staged;Booted

const (
	// DesiredImageStateStaged means the daemon should stage the image
	// but not reboot into it.
	DesiredImageStateStaged DesiredImageState = "Staged"

	// DesiredImageStateBooted means the daemon should apply the staged
	// image and reboot into it.
	DesiredImageStateBooted DesiredImageState = "Booted"
)

type DisruptionSpec

type DisruptionSpec struct {
	// rebootPolicy defines how nodes should be rebooted during updates.
	// "RebootOnly" always performs a full node reboot.
	// "AllowSoftReboot" performs a userspace-only restart when the
	// update supports it, falling back to a full reboot otherwise.
	// Defaults to "RebootOnly".
	// +optional
	// +kubebuilder:default=RebootOnly
	RebootPolicy RebootPolicy `json:"rebootPolicy,omitempty"`
}

DisruptionSpec controls the disruption behavior during updates.

func (*DisruptionSpec) DeepCopy

func (in *DisruptionSpec) DeepCopy() *DisruptionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionSpec.

func (*DisruptionSpec) DeepCopyInto

func (in *DisruptionSpec) DeepCopyInto(out *DisruptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageInfo

type ImageInfo struct {
	// image is the full image pullspec (e.g.
	// "quay.io/example/myos@sha256:abc123").
	// +required
	Image string `json:"image"`

	// imageDigest is the image digest (e.g. "sha256:abc123").
	// +required
	ImageDigest string `json:"imageDigest"`

	// version is the image version string, if any.
	// +optional
	Version string `json:"version,omitempty"`

	// timestamp is the image build timestamp, if any.
	// +optional
	Timestamp *metav1.Time `json:"timestamp,omitempty"`

	// architecture is the hardware architecture of the image
	// (e.g. "amd64").
	// +optional
	Architecture string `json:"architecture,omitempty"`

	// softRebootCapable is true if this boot entry supports a
	// userspace-only restart relative to the currently booted system.
	// +optional
	SoftRebootCapable bool `json:"softRebootCapable,omitempty"`

	// incompatible is true if the boot entry has local mutations that
	// bootc cannot manage (e.g. package layering via rpm-ostree).
	// +optional
	Incompatible bool `json:"incompatible,omitempty"`
}

ImageInfo describes an OS image in a boot slot. Used for the booted, staged, and rollback entries. Fields are populated from bootc status; not all fields are present for every slot.

func (*ImageInfo) DeepCopy

func (in *ImageInfo) DeepCopy() *ImageInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageInfo.

func (*ImageInfo) DeepCopyInto

func (in *ImageInfo) DeepCopyInto(out *ImageInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageSpec

type ImageSpec struct {
	// ref is the image reference, either a tag (e.g. "quay.io/example/myos:latest")
	// or a digest (e.g. "quay.io/example/myos@sha256:abc123").
	// +required
	// +kubebuilder:validation:MinLength=1
	Ref string `json:"ref"`
}

ImageSpec defines the desired OS image for a pool.

func (*ImageSpec) DeepCopy

func (in *ImageSpec) DeepCopy() *ImageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec.

func (*ImageSpec) DeepCopyInto

func (in *ImageSpec) DeepCopyInto(out *ImageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PullSecretRef

type PullSecretRef struct {
	// name is the name of the Secret.
	// +required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// namespace is the namespace of the Secret.
	// +required
	// +kubebuilder:validation:MinLength=1
	Namespace string `json:"namespace"`
}

PullSecretRef references a Secret containing image pull credentials.

func (*PullSecretRef) DeepCopy

func (in *PullSecretRef) DeepCopy() *PullSecretRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullSecretRef.

func (*PullSecretRef) DeepCopyInto

func (in *PullSecretRef) DeepCopyInto(out *PullSecretRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RebootPolicy

type RebootPolicy string

RebootPolicy defines how a node should be rebooted during updates. +kubebuilder:validation:Enum=RebootOnly;AllowSoftReboot

const (
	// RebootPolicyRebootOnly always performs a full node reboot.
	RebootPolicyRebootOnly RebootPolicy = "RebootOnly"

	// RebootPolicyAllowSoftReboot performs a userspace-only restart
	// when the update supports it, falling back to a full reboot
	// otherwise.
	RebootPolicyAllowSoftReboot RebootPolicy = "AllowSoftReboot"
)

type RolloutSpec

type RolloutSpec struct {
	// maxUnavailable is the maximum number of nodes that can be unavailable
	// during a rolling update. Value can be an absolute number (e.g. 1) or
	// a percentage of total nodes in the pool (e.g. "25%"). Defaults to 1.
	// +optional
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

	// paused prevents the operator from starting new rollouts. Nodes that
	// are already mid-staging will complete their staging. Tag resolution
	// continues and status.targetDigest is kept current.
	// +optional
	Paused bool `json:"paused,omitempty"`

	// drainTimeoutSeconds is the maximum time in seconds to wait for a
	// node drain to complete before marking the node degraded and freeing
	// the reboot slot. If not set, drains block indefinitely.
	// +optional
	// +kubebuilder:validation:Minimum=0
	DrainTimeoutSeconds *int32 `json:"drainTimeoutSeconds,omitempty"`
}

RolloutSpec controls how updates are rolled out across pool nodes.

func (*RolloutSpec) DeepCopy

func (in *RolloutSpec) DeepCopy() *RolloutSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutSpec.

func (*RolloutSpec) DeepCopyInto

func (in *RolloutSpec) DeepCopyInto(out *RolloutSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL