Skip to content

Add MachineOperation, MachineConfiguration, and MachineConfigurationVersion CRDs#96

Open
bcho wants to merge 2 commits intomainfrom
hbc/op-cr
Open

Add MachineOperation, MachineConfiguration, and MachineConfigurationVersion CRDs#96
bcho wants to merge 2 commits intomainfrom
hbc/op-cr

Conversation

@bcho
Copy link
Copy Markdown
Member

@bcho bcho commented Apr 28, 2026

Summary

Adds three new custom resource definitions following the design in New CRDs, derived from the prototype in #59:

  • MachineOperation (mop): discrete operations (SoftReboot, HardReboot) targeting machines
  • MachineConfiguration (mc): deployment-like configuration profiles with update strategies and machine selectors
  • MachineConfigurationVersion (mcv): immutable versioned snapshots of configuration templates
  • Extends the Machine CR with configurationRef (spec), configuration status, NodeUpdated and ConfigurationPending conditions, and AnnotationConfigurationVersion
  • Includes generated deepcopy methods and CRD manifests

This PR contains only the CR type definitions and generated artifacts. Controller, CLI, and agent implementations will follow in subsequent PRs.

@bcho bcho force-pushed the hbc/op-cr branch 6 times, most recently from 274c166 to 8b7ed42 Compare April 28, 2026 18:13
@bcho bcho marked this pull request as ready for review April 28, 2026 18:15
@bcho bcho requested a review from a team April 28, 2026 18:15
…ersion CRDs

Port custom resource type definitions from hbc/agent-op-cr-poc:
- MachineOperation: discrete operations (Reboot, HardReboot) on machines
- MachineConfiguration: deployment-like config profiles with update strategies
- MachineConfigurationVersion: immutable versioned snapshots of configurations
- Machine CR additions: configurationRef, configuration status, NodeUpdated
  condition, and configuration version annotation
// MachineRef is the name of the Machine CR this operation targets.
// Either machineRef or machineSelector must be set.
// +optional
MachineRef string `json:"machineRef,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about the VM operations here, so we have an assumption that Machine CR will contain necessary identifying information for the operations?

e.g. ARM ResourceID and Tenant for Azure, Proxmox VMID and pve endpoint, etc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think we will need a way to correlate the cloud provider identity in machine side. Or we can correlate with the cloud provider id from node then to machine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably label the machine with this info or put it into the CR. I'm not sure what is the most ergonomic, but we do need some way of mapping a given machine to it's underlying host.

I guess how does the inventory piece fit in here?

@jveski @cchildress might have some more info

// MachineOperation is kept indefinitely.
// +optional
// +kubebuilder:validation:Minimum=0
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if each operation should have TTL as well. It feels like we could get an operation stuck in a Pending state pretty easily

Comment thread api/machina/v1alpha3/machineoperation_types.go
bcho added a commit that referenced this pull request Apr 28, 2026
Adopt CRD type definitions from #96 (MachineOperation, MachineConfiguration,
MachineConfigurationVersion). Update implementations:

- Rename OperationName -> OperationKind, OperationReboot -> OperationSoftReboot
- Convert RegisterWithTaints from []string to []corev1.Taint in MCV overlay
- Add taint parse/format helpers for kubectl-unbounded
- Remove old operation_types.go (superseded by machineoperation_types.go)
- Add MachineConditionConfigurationPending constant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants