@@ -20,7 +20,6 @@ import (
20
20
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
21
22
22
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
23
- "sigs.k8s.io/cluster-api/errors"
24
23
)
25
24
26
25
const (
@@ -54,6 +53,16 @@ const (
54
53
IgnitionStorageTypeOptionUnencryptedUserData = IgnitionStorageTypeOption ("UnencryptedUserData" )
55
54
)
56
55
56
+ // NetworkInterfaceType is the type of network interface.
57
+ type NetworkInterfaceType string
58
+
59
+ const (
60
+ // NetworkInterfaceTypeENI means the network interface type is Elastic Network Interface.
61
+ NetworkInterfaceTypeENI NetworkInterfaceType = NetworkInterfaceType ("interface" )
62
+ // NetworkInterfaceTypeEFAWithENAInterface means the network interface type is Elastic Fabric Adapter with Elastic Network Adapter.
63
+ NetworkInterfaceTypeEFAWithENAInterface NetworkInterfaceType = NetworkInterfaceType ("efa" )
64
+ )
65
+
57
66
// AWSMachineSpec defines the desired state of an Amazon EC2 instance.
58
67
type AWSMachineSpec struct {
59
68
// ProviderID is the unique identifier as specified by the cloud provider.
@@ -153,6 +162,12 @@ type AWSMachineSpec struct {
153
162
// +kubebuilder:validation:MaxItems=2
154
163
NetworkInterfaces []string `json:"networkInterfaces,omitempty"`
155
164
165
+ // NetworkInterfaceType is the interface type of the primary network Interface.
166
+ // If not specified, AWS applies a default value.
167
+ // +kubebuilder:validation:Enum=interface;efa
168
+ // +optional
169
+ NetworkInterfaceType NetworkInterfaceType `json:"networkInterfaceType,omitempty"`
170
+
156
171
// UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance.
157
172
// cloud-init has built-in support for gzip-compressed user data
158
173
// user data stored in aws secret manager is always gzip-compressed.
@@ -197,6 +212,15 @@ type AWSMachineSpec struct {
197
212
// CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched.
198
213
// +optional
199
214
CapacityReservationID * string `json:"capacityReservationId,omitempty"`
215
+
216
+ // MarketType specifies the type of market for the EC2 instance. Valid values include:
217
+ // "OnDemand" (default): The instance runs as a standard OnDemand instance.
218
+ // "Spot": The instance runs as a Spot instance. When SpotMarketOptions is provided, the marketType defaults to "Spot".
219
+ // "CapacityBlock": The instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
220
+ // If this value is selected, CapacityReservationID must be specified to identify the target reservation.
221
+ // If marketType is not specified and spotMarketOptions is provided, the marketType defaults to "Spot".
222
+ // +optional
223
+ MarketType MarketType `json:"marketType,omitempty"`
200
224
}
201
225
202
226
// CloudInit defines options related to the bootstrapping systems where
@@ -352,7 +376,7 @@ type AWSMachineStatus struct {
352
376
// can be added as events to the Machine object and/or logged in the
353
377
// controller's output.
354
378
// +optional
355
- FailureReason * errors. MachineStatusError `json:"failureReason,omitempty"`
379
+ FailureReason * string `json:"failureReason,omitempty"`
356
380
357
381
// FailureMessage will be set in the event that there is a terminal problem
358
382
// reconciling the Machine and will contain a more verbose string suitable
0 commit comments