Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws-eks] There is already a Construct with name 'chart-spot-interrupt-handler' in Cluster [EKSCluster] #7524

Closed
chrisdrobison opened this issue Apr 22, 2020 · 1 comment · Fixed by #7760
Assignees
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. p1

Comments

@chrisdrobison
Copy link

Adding two autoscaling groups that are both spot will result in an error:

There is already a Construct with name 'chart-spot-interrupt-handler' in Cluster [EKSCluster]

The reason I would do this is if I need to create a worker node group with a taint set for special work loads.

Reproduction Steps

const eksCluster = new eks.Cluster(this, "EKSCluster", {
            vpc: vpc,
            vpcSubnets: [
                { subnetType: ec2.SubnetType.PRIVATE }
            ],
            version: "1.15",
            defaultCapacity: 0
        });

        const autoScalingGroup = new autoscaling.AutoScalingGroup(this, "Worker-Group", {
            vpc: vpc,
            instanceType: new ec2.InstanceType("t3a.xlarge"),
            machineImage: ec2.MachineImage.lookup({ name: "custom-image-name" }),
            minCapacity: 1,
            maxCapacity: 10,
            updateType: autoscaling.UpdateType.ROLLING_UPDATE,
            spotPrice: '0.10'
        });
        eksCluster.addAutoScalingGroup(autoScalingGroup, {});

        const autoScalingGroup2 = new autoscaling.AutoScalingGroup(this, "Worker-Group-2", {
            vpc: vpc,
            instanceType: new ec2.InstanceType("t3a.xlarge"),
            machineImage: ec2.MachineImage.lookup({ name: "custom-image-name" }),
            minCapacity: 1,
            maxCapacity: 10,
            updateType: autoscaling.UpdateType.ROLLING_UPDATE,
            spotPrice: '0.10'
        });
        eksCluster.addAutoScalingGroup(autoScalingGroup2, {});

Error Log

C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules\constructs\lib\construct.ts:487
throw new Error(There is already a Construct with name '${childName}' in ${typeName}${name.length > 0 ? ' [' + name + ']' : ''});
^
Error: There is already a Construct with name 'chart-spot-interrupt-handler' in Cluster [EKSCluster]
at Node.addChild (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules\constructs\lib\construct.ts:487:13)
at new Node (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules\constructs\lib\construct.ts:73:22)
at new ConstructNode (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules@aws-cdk\core\lib\construct-compat.ts:266:24)
at Object.createNode (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules@aws-cdk\core\lib\construct-compat.ts:71:11)
at new Construct (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules\constructs\lib\construct.ts:528:26)
at new Construct (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\node_modules@aws-cdk\core\lib\construct-compat.ts:68:5)
at new HelmChart (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\lib\helm-chart.ts:77:5)
at Cluster.addChart (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\lib\cluster.ts:650:12)
at Cluster.addAutoScalingGroup (C:\dev\platform-cdk\node_modules@aws-cdk\aws-eks\lib\cluster.ts:600:12)
at new PlatformEks (C:\dev\platform-cdk\lib\platform-eks.ts:55:20)

Environment

  • CLI Version : 1.34.1
  • Framework Version: 1.34.1
  • OS : Windows 10
  • Language : Typescript

Other


This is 🐛 Bug Report

@chrisdrobison chrisdrobison added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 22, 2020
@SomayaB SomayaB added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Apr 23, 2020
@eladb
Copy link
Contributor

eladb commented May 3, 2020

Fix in progress

@eladb eladb added in-progress This issue is being actively worked on. p1 labels May 3, 2020
eladb pushed a commit that referenced this issue May 3, 2020
Install only a single instance of the spot termination handler helm chart, even if there are multiple capacities or ASGs the use spot instances.

Fixes #7136
Fixes #7524
@mergify mergify bot closed this as completed in #7760 May 4, 2020
mergify bot pushed a commit that referenced this issue May 4, 2020
Install only a single instance of the spot termination handler helm chart, even if there are multiple capacities or ASGs the use spot instances.

Fixes #7136
Fixes #7524
@iliapolo iliapolo changed the title There is already a Construct with name 'chart-spot-interrupt-handler' in Cluster [EKSCluster] [aws-eks] There is already a Construct with name 'chart-spot-interrupt-handler' in Cluster [EKSCluster] Aug 16, 2020
@iliapolo iliapolo removed needs-triage This issue or PR still needs to be triaged. in-progress This issue is being actively worked on. labels Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants