@@ -20,7 +20,6 @@ import (
2020 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
2222 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
23- "sigs.k8s.io/cluster-api/errors"
2423)
2524
2625const (
@@ -54,6 +53,16 @@ const (
5453 IgnitionStorageTypeOptionUnencryptedUserData = IgnitionStorageTypeOption ("UnencryptedUserData" )
5554)
5655
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+
5766// AWSMachineSpec defines the desired state of an Amazon EC2 instance.
5867type AWSMachineSpec struct {
5968 // ProviderID is the unique identifier as specified by the cloud provider.
@@ -153,6 +162,12 @@ type AWSMachineSpec struct {
153162 // +kubebuilder:validation:MaxItems=2
154163 NetworkInterfaces []string `json:"networkInterfaces,omitempty"`
155164
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+
156171 // UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance.
157172 // cloud-init has built-in support for gzip-compressed user data
158173 // user data stored in aws secret manager is always gzip-compressed.
@@ -197,6 +212,15 @@ type AWSMachineSpec struct {
197212 // CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched.
198213 // +optional
199214 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"`
200224}
201225
202226// CloudInit defines options related to the bootstrapping systems where
@@ -352,7 +376,7 @@ type AWSMachineStatus struct {
352376 // can be added as events to the Machine object and/or logged in the
353377 // controller's output.
354378 // +optional
355- FailureReason * errors. MachineStatusError `json:"failureReason,omitempty"`
379+ FailureReason * string `json:"failureReason,omitempty"`
356380
357381 // FailureMessage will be set in the event that there is a terminal problem
358382 // reconciling the Machine and will contain a more verbose string suitable
0 commit comments