Skip to content

Commit

Permalink
The amazon-vpc-cni is not created by default so we need to override t…
Browse files Browse the repository at this point in the history
…he value for windows
  • Loading branch information
ROunofF committed Apr 2, 2024
1 parent b210cca commit 25e709f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
18 changes: 7 additions & 11 deletions lib/windows-construct/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class WindowsConstruct {
kubernetesVersion: eks.KubernetesVersion.of("1.27"),
instanceClass: ec2.InstanceClass.T3,
instanceSize: ec2.InstanceSize.MEDIUM,
desiredNodeCount: 1,
desiredNodeSize: 1,
minNodeSize: 1,
maxNodeSize: 3,
blockDeviceSize: 50,
Expand All @@ -33,17 +33,13 @@ export default class WindowsConstruct {
"Name": "blueprints-windows-eks-cluster",
"Type": "generic-windows-cluster"
},
genericNodeGroupOptions: {
nodegroupName: "Mng-linux",
tags: {
"kubernetes.io/cluster/windows-eks-blueprint": "owned"
},
genericNodeGroupTags: {
"Name": "Mng-linux",
"kubernetes.io/cluster/windows-eks-blueprint": "owned"
},
windowsNodeGroupOptions: {
nodegroupName: "Mng-windows",
tags: {
"kubernetes.io/cluster/windows-eks-blueprint": "owned"
}
windowsNodeGroupTags: {
"Name" : "Mng-windows",
"kubernetes.io/cluster/windows-eks-blueprint": "owned"
}
};

Expand Down
24 changes: 13 additions & 11 deletions lib/windows-construct/vpc-cni/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import * as blueprints from '@aws-quickstart/eks-blueprints';
import { KubernetesManifest } from 'aws-cdk-lib/aws-eks';
import { Construct } from 'constructs';

export class WindowsVpcCni implements blueprints.ClusterAddOn {
id: "amazon-vpc-cni";

deploy(clusterInfo: blueprints.ClusterInfo): void | Promise<Construct> {
const cluster = clusterInfo.cluster;
const configmap = cluster.addManifest("amazon-vpc-cni", {
apiVersion: "v1",
kind: "ConfigMap",
metadata: {
name: "amazon-vpc-cni",
namespace: "kube-system",
},
data:{
"enable-windows-ipam": "true"
},
});
const configmap = new KubernetesManifest(cluster, 'amazon-vpc-cni', { cluster: cluster,
manifest : [{
apiVersion: "v1",
kind: "ConfigMap",
metadata: {
name: "amazon-vpc-cni",
namespace: "kube-system",
},
data:{
"enable-windows-ipam": "true"
},
}], overwrite: true });

return Promise.resolve(configmap);
}
Expand Down

0 comments on commit 25e709f

Please sign in to comment.