Skip to content

Commit

Permalink
Bug(bottlerocket) fix volume mount for non-efa use case (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
Issacwww authored Nov 28, 2024
1 parent a657451 commit 1b11bd3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions kubetest2/internal/deployers/eksapi/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func (m *NodegroupManager) createUnmanagedNodegroup(infra *Infrastructure, clust
if err != nil {
return err
}
volumeMountPath := "/dev/xvda"
if opts.UserDataFormat == "bottlerocket" {
volumeMountPath = "/dev/xvdb"
}
// pull the role name out of the ARN
nodeRoleArnParts := strings.Split(infra.nodeRole, "/")
nodeRoleName := nodeRoleArnParts[len(nodeRoleArnParts)-1]
Expand Down Expand Up @@ -228,6 +232,10 @@ func (m *NodegroupManager) createUnmanagedNodegroup(infra *Infrastructure, clust
ParameterKey: aws.String("AMIId"),
ParameterValue: aws.String(opts.AMI),
},
{
ParameterKey: aws.String("VolumeMountPath"),
ParameterValue: aws.String(volumeMountPath),
},
},
}
out, err := m.clients.CFN().CreateStack(context.TODO(), &input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Parameters:
UserData:
Type: String

VolumeMountPath:
Type: String

UserDataIsMIMEPart:
Description: "User data should be embedded as a part of a multi-part MIME document"
Default: true
Expand Down Expand Up @@ -130,7 +133,7 @@ Resources:
ImageId: !Ref AMIId
InstanceType: "{{index .InstanceTypes 0}}"
BlockDeviceMappings:
- DeviceName: /dev/xvda
- DeviceName: !Ref VolumeMountPath
Ebs:
VolumeSize: !Ref NodeDiskSize
VolumeType: gp2
Expand Down

0 comments on commit 1b11bd3

Please sign in to comment.