Skip to content

Commit

Permalink
fix(eks): failures when creating or updating clusters (#5540)
Browse files Browse the repository at this point in the history
There were two causes of timeouts for EKS cluster creation: create time which is longer than the AWS Lambda timeout (15min) and lack of retry when applying kubectl after the cluster has been created.

The change fixes the first issue by leveraging the custom resource provider framework to implement the cluster resource as an async resource. The custom resource providers are now bundled as nested stacks so they don't take up too many resources from users, and are also reused by multiple clusters within the same stack. This required that the creation role will not be the same as the lambda role, so we define this role separately and assume it within the providers.

The second issue is fixed by adding 3 retries to "kubectl apply".

**Backwards compatibility**: as described in #5544, since the resource provider handler of `Cluster` and `KubernetesResource` has been changed, this change requires a replacement of existing clusters (deployment fails with "service token cannot be changed" error). Since this can be disruptive to users, this change includes an exact copy of the previous version under a new module called `@aws-cdk/aws-eks-legacy`, which can be used as a drop-in replacement until users decide to upgrade to the new version. Using the legacy cluster will emit a synthesis warning that this module will no longer be released as part of the CDK starting March 1st, 2020.

- Fixes #4087
- Fixes #4695
- Fixes #5259
- Fixes #5501

---

BREAKING CHANGE: (in experimental module) the providers behind the AWS EKS module have been rewritten to address multiple stability issues. Since this change requires cluster replacement, the old version of this module is available under `@aws-cdk/aws-eks-legacy`. Please read aws/aws-cdk#5544 carefully for upgrade instructions.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Elad Ben-Israel and mergify[bot] committed Jan 18, 2022
1 parent d4200a3 commit 5a9652c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/decdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@
"jsii-reflect": "^0.20.11",
"jsonschema": "^1.2.5",
"yaml": "1.7.2",
"yargs": "^15.0.1"
"yargs": "^15.0.1",
"@aws-cdk/aws-eks-legacy": "1.19.0"
},
"devDependencies": {
"@types/fs-extra": "^8.0.1",
Expand Down

0 comments on commit 5a9652c

Please sign in to comment.