Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep imdvs2 false only for linux
Browse files Browse the repository at this point in the history
ROunofF committed Sep 28, 2023
1 parent 98b1b6b commit b143061
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/common/windows-builder.ts
Original file line number Diff line number Diff line change
@@ -81,10 +81,10 @@ export class UsageTrackingAddOn extends NestedStack {

function getInstanceType(options: WindowsOptions, nodegroup: blueprints.ManagedNodeGroup): ec2.InstanceType[] {

if ( nodegroup.instanceTypes ) { return nodegroup.instanceTypes }
if ( nodegroup.instanceTypes ) { return nodegroup.instanceTypes; }

if ( options.instanceClass && options.instanceSize )
return [ new ec2.InstanceType(`${options.instanceClass}.${options.instanceSize}`) ]
return [ new ec2.InstanceType(`${options.instanceClass}.${options.instanceSize}`) ];

return [ new ec2.InstanceType('m5.4xlarge')];
}
@@ -101,16 +101,13 @@ function addGenericNodeGroup(options: WindowsOptions, overrideOptions: blueprint
nodeRole: overrideOptions.nodeRole ?? blueprints.getNamedResource("node-role") as iam.Role,
nodeGroupSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
tags: overrideOptions.tags,
launchTemplate: {
tags: overrideOptions.tags,
requireImdsv2: false
}
launchTemplate: overrideOptions.launchTemplate
};
}

function addWindowsNodeGroup(options: WindowsOptions): blueprints.ManagedNodeGroup {

if (options.windowsNodeGroupOptions.amiType == null) { options.windowsNodeGroupOptions.amiType = NodegroupAmiType.WINDOWS_CORE_2022_X86_64 }
if (options.windowsNodeGroupOptions.amiType == null) { options.windowsNodeGroupOptions.amiType = NodegroupAmiType.WINDOWS_CORE_2022_X86_64; }
const result = addGenericNodeGroup(options, options.windowsNodeGroupOptions);

if(options.noScheduleForWindowsNodes) {
6 changes: 6 additions & 0 deletions lib/windows-construct/index.ts
Original file line number Diff line number Diff line change
@@ -35,6 +35,12 @@ export default class WindowsConstruct {
},
genericNodeGroupOptions: {
id: "Mng-linux",
tags: {
"kubernetes.io/cluster/windows-eks-blueprint": "owned"
},
launchTemplate: {
requireImdsv2 : false
}
},
windowsNodeGroupOptions: {
id: "Mng-windows",

0 comments on commit b143061

Please sign in to comment.