Skip to content

Commit

Permalink
Placement group should not be created when using a reservation (#8220)
Browse files Browse the repository at this point in the history
bug: placement group should not be added for reservation

Reservations are special cases that often can be created
with placement already in mind, or have instances in different
availability zones (or far enough away) so adding a placement
group automatically will prevent provision of a large set of
resources. Changing the default behavior to always require the
user to specify a placement group for EFA is overkill, but
a good balance is, in the case EFA is enabled and there is no
placement group, when there is a reservation do not add the
group automatically, but issue a warning to the user they can
choose to respond to. TLDR: when a user deploys a cluster via
a reservation they are responsible for adding the placement
group.

Signed-off-by: vsoch <[email protected]>
Co-authored-by: vsoch <[email protected]>
  • Loading branch information
vsoch and vsoch authored Feb 19, 2025
1 parent c01cb8e commit eb6202f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cfn/builder/managed_launch_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ func (m *ManagedNodeGroupResourceSet) makeLaunchTemplateData(ctx context.Context
if err := buildNetworkInterfaces(ctx, launchTemplateData, mng.InstanceTypeList(), true, securityGroupIDs, m.ec2API); err != nil {
return nil, fmt.Errorf("couldn't build network interfaces for launch template data: %w", err)
}
if mng.Placement == nil {
// A reservation should already be created with a placement group
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html
if mng.Placement == nil && mng.CapacityReservation == nil {
groupName := m.newResource("NodeGroupPlacementGroup", &gfnec2.PlacementGroup{
Strategy: gfnt.NewString("cluster"),
})
Expand Down

0 comments on commit eb6202f

Please sign in to comment.