Skip to content

Conversation

@bryan-cox
Copy link
Contributor

@bryan-cox bryan-cox commented Jan 19, 2026

Summary

  • Add centralized Architecture type and NodeInfo struct to both v1beta1 and v1beta2 core APIs
  • These types enable infrastructure providers to implement the status.nodeInfo field on Infrastructure Machine Templates as defined in the Opt-in Autoscaling from Zero proposal
  • Eliminates the need for providers to independently copy and maintain these type definitions, ensuring consistency across the Cluster API ecosystem

Background

The Opt-in Autoscaling from Zero proposal introduced the concept of scaling from zero replicas, which requires infrastructure providers to expose node capacity and metadata information via a status.nodeInfo field on Infrastructure Machine Templates.

Currently, all CAPI providers following this proposal must either:

  1. Copy the same type definitions into their codebases, or
  2. Reuse/import from other providers

This leads to code duplication and potential inconsistencies. This PR centralizes these types so all providers can import and use the same standardized definitions.

You can see the duplication happening in both CAPA and CAPZ so far:

  1. https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/ea252592b45d62f2eeab6b6ace2c35b2f7bad2c2/api/v1beta2/awsmachinetemplate_types.go#L28
  2. feat: Implement autoscaling from zero by auto-populating AzureMachineTemplate capacity/nodeInfo cluster-api-provider-azure#6013

Changes

  • Added Architecture type with constants: amd64, arm64, s390x, ppc64le
  • Added NodeInfo struct with architecture and operatingSystem fields
  • Types added to both api/core/v1beta1 and api/core/v1beta2
  • Ran make generate to update generated files

Provider Usage

// v1beta2
import clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
arch := clusterv1.ArchitectureAmd64

// v1beta1
import clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
arch := clusterv1beta1.ArchitectureAmd64

Test plan

  • make generate passes
  • make test passes
  • make lint passes (Go linting; Dockerfile lint requires Docker daemon)

🤖 Generated with Claude Code

Provide repository guidance for AI agents covering commands,
architecture, and development patterns.

Signed-off-by: Bryan Cox <[email protected]>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the do-not-merge/needs-area PR is missing an area label label Jan 19, 2026
@k8s-ci-robot
Copy link
Contributor

This PR is currently missing an area label, which is used to identify the modified component when generating release notes.

Area labels can be added by org members by writing /area ${COMPONENT} in a comment

Please see the labels list for possible areas.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 19, 2026
@bryan-cox bryan-cox changed the title feat(api): add Architecture and NodeInfo types to core API ✨ feat(api): add Architecture and NodeInfo types to core API Jan 19, 2026
@bryan-cox
Copy link
Contributor Author

Should this PR get merged, I'm happy to go update both CAPA and CAPZ to use this centralized implementation.

Add centralized Architecture type and NodeInfo struct to both v1beta1
and v1beta2 core APIs. These types enable infrastructure providers to
implement the status.nodeInfo field on Infrastructure Machine Templates
as defined in the Opt-in Autoscaling from Zero proposal.

This eliminates the need for providers to independently copy and
maintain these type definitions, ensuring consistency across the
Cluster API ecosystem.

Supported architectures: amd64, arm64, s390x, ppc64le

Signed-off-by: Bryan Cox <[email protected]>
@bryan-cox bryan-cox force-pushed the add-cpu-and-node-info branch from 1a2d7b3 to 57207d8 Compare January 19, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants