Skip to content

Commit

Permalink
capacity-resevation requries efa
Browse files Browse the repository at this point in the history
  • Loading branch information
Issacwww committed Sep 16, 2024
1 parent 7483b1b commit 14d3d10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kubetest2/internal/deployers/eksapi/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type deployerOptions struct {
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."`
AMI string `flag:"ami" desc:"AMI for unmanaged nodes"`
AMIType string `flag:"ami-type" desc:"AMI type for managed nodes"`
CapacityReservation bool `flag:"capacity-reservation" desc:"Use capacity reservation for the unmanaged nodegroup"`
CapacityReservation bool `flag:"capacity-reservation" desc:"Use capacity reservation for the efa unmanaged nodegroup. Requires --efa"`
ClusterRoleServicePrincipal string `flag:"cluster-role-service-principal" desc:"Additional service principal that can assume the cluster role"`
EFA bool `flag:"efa" desc:"Create EFA interfaces on the node of an unmanaged nodegroup. Requires --unmanaged-nodes."`
EKSEndpointURL string `flag:"endpoint-url" desc:"Endpoint URL for the EKS API"`
Expand Down Expand Up @@ -245,6 +245,10 @@ func (d *deployer) verifyUpFlags() error {
d.UserDataFormat = "bootstrap.sh"
klog.V(2).Infof("Using default user data format: %s", d.UserDataFormat)
}
if d.CapacityReservation && !d.EFA{
//For now the reserved capacity are all for efa device, may extend when non-efa instance introduced
return fmt.Errorf("--capacity-reservation requires --efa flag")
}
if d.EFA && len(d.InstanceTypes) != 1 {
return fmt.Errorf("--efa requires a single instance type")
}
Expand Down

0 comments on commit 14d3d10

Please sign in to comment.