Skip to content

Commit f02a539

Browse files
add AWSMachineTemplate NodeInfo
1 parent 5abc575 commit f02a539

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

api/v1beta1/zz_generated.conversion.go

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta2/awsmachinetemplate_types.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,43 @@ import (
2323
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2424
)
2525

26+
// Architecture represents the CPU architecture of the node.
27+
// Its underlying type is a string and its value can be any of amd64, arm64.
28+
// +kubebuilder:validation:Enum=amd64;arm64
29+
// +enum
30+
type Architecture string
31+
32+
// Architecture constants.
33+
const (
34+
ArchitectureAmd64 Architecture = "amd64"
35+
ArchitectureArm64 Architecture = "arm64"
36+
)
37+
38+
// NodeInfo contains information about the node's architecture and operating system.
39+
type NodeInfo struct {
40+
// Architecture is the CPU architecture of the node.
41+
// Its underlying type is a string and its value can be any of amd64, arm64.
42+
// +optional
43+
Architecture Architecture `json:"architecture,omitempty"`
44+
// OperatingSystem is a string representing the operating system of the node.
45+
// This may be a string like 'linux' or 'windows'.
46+
// +optional
47+
OperatingSystem string `json:"operatingSystem,omitempty"`
48+
}
49+
2650
// AWSMachineTemplateStatus defines a status for an AWSMachineTemplate.
2751
type AWSMachineTemplateStatus struct {
2852
// Capacity defines the resource capacity for this machine.
2953
// This value is used for autoscaling from zero operations as defined in:
3054
// https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
3155
// +optional
3256
Capacity corev1.ResourceList `json:"capacity,omitempty"`
57+
58+
// NodeInfo contains information about the node's architecture and operating system.
59+
// This value is used for autoscaling from zero operations as defined in:
60+
// https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
61+
// +optional
62+
NodeInfo *NodeInfo `json:"nodeInfo,omitempty"`
3363
}
3464

3565
// AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate.

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,26 @@ spec:
11341134
This value is used for autoscaling from zero operations as defined in:
11351135
https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
11361136
type: object
1137+
nodeInfo:
1138+
description: |-
1139+
NodeInfo contains information about the node's architecture and operating system.
1140+
This value is used for autoscaling from zero operations as defined in:
1141+
https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
1142+
properties:
1143+
architecture:
1144+
description: |-
1145+
Architecture is the CPU architecture of the node.
1146+
Its underlying type is a string and its value can be any of amd64, arm64.
1147+
enum:
1148+
- amd64
1149+
- arm64
1150+
type: string
1151+
operatingSystem:
1152+
description: |-
1153+
OperatingSystem is a string representing the operating system of the node.
1154+
This may be a string like 'linux' or 'windows'.
1155+
type: string
1156+
type: object
11371157
type: object
11381158
type: object
11391159
served: true

0 commit comments

Comments
 (0)