Skip to content

Commit 14d3d10

Browse files
committed
capacity-resevation requries efa
1 parent 7483b1b commit 14d3d10

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kubetest2/internal/deployers/eksapi/deployer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type deployerOptions struct {
5454
Addons []string `flag:"addons" desc:"Managed addons (name:version pairs) to create in the cluster. Use 'latest' for the most recent version, or 'default' for the default version."`
5555
AMI string `flag:"ami" desc:"AMI for unmanaged nodes"`
5656
AMIType string `flag:"ami-type" desc:"AMI type for managed nodes"`
57-
CapacityReservation bool `flag:"capacity-reservation" desc:"Use capacity reservation for the unmanaged nodegroup"`
57+
CapacityReservation bool `flag:"capacity-reservation" desc:"Use capacity reservation for the efa unmanaged nodegroup. Requires --efa"`
5858
ClusterRoleServicePrincipal string `flag:"cluster-role-service-principal" desc:"Additional service principal that can assume the cluster role"`
5959
EFA bool `flag:"efa" desc:"Create EFA interfaces on the node of an unmanaged nodegroup. Requires --unmanaged-nodes."`
6060
EKSEndpointURL string `flag:"endpoint-url" desc:"Endpoint URL for the EKS API"`
@@ -245,6 +245,10 @@ func (d *deployer) verifyUpFlags() error {
245245
d.UserDataFormat = "bootstrap.sh"
246246
klog.V(2).Infof("Using default user data format: %s", d.UserDataFormat)
247247
}
248+
if d.CapacityReservation && !d.EFA{
249+
//For now the reserved capacity are all for efa device, may extend when non-efa instance introduced
250+
return fmt.Errorf("--capacity-reservation requires --efa flag")
251+
}
248252
if d.EFA && len(d.InstanceTypes) != 1 {
249253
return fmt.Errorf("--efa requires a single instance type")
250254
}

0 commit comments

Comments
 (0)