Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 483c862

Browse files
committedJul 9, 2024
added prop bootstrapSelfManagedAddons
1 parent 046bf56 commit 483c862

File tree

5 files changed

+2028
-2344
lines changed

5 files changed

+2028
-2344
lines changed
 

‎packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/cluster-resource-handler/cluster.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ export class ClusterResourceHandler extends ResourceHandler {
116116
// if there is an update that requires replacement, go ahead and just create
117117
// a new cluster with the new config. The old cluster will automatically be
118118
// deleted by cloudformation upon success.
119-
if (updates.replaceName || updates.replaceRole || updates.updateBootstrapClusterCreatorAdminPermissions ) {
119+
if (updates.replaceName || updates.replaceRole ||
120+
updates.updateBootstrapClusterCreatorAdminPermissions || updates.updateBootstrapSelfManagedAddons ) {
120121
// if we are replacing this cluster and the cluster has an explicit
121122
// physical name, the creation of the new cluster will fail with "there is
122123
// already a cluster with that name". this is a common behavior for
@@ -412,6 +413,7 @@ interface UpdateMap {
412413
updateBootstrapClusterCreatorAdminPermissions: boolean; // accessConfig.bootstrapClusterCreatorAdminPermissions
413414
updateVpc: boolean; // resourcesVpcConfig.subnetIds and securityGroupIds
414415
updateTags: boolean; // tags
416+
updateBootstrapSelfManagedAddons: boolean; // cluster with default networking add-ons
415417
}
416418

417419
function analyzeUpdate(oldProps: Partial<EKS.CreateClusterCommandInput>, newProps: EKS.CreateClusterCommandInput): UpdateMap {
@@ -445,6 +447,7 @@ function analyzeUpdate(oldProps: Partial<EKS.CreateClusterCommandInput>, newProp
445447
updateBootstrapClusterCreatorAdminPermissions: JSON.stringify(newAccessConfig.bootstrapClusterCreatorAdminPermissions) !==
446448
JSON.stringify(oldAccessConfig.bootstrapClusterCreatorAdminPermissions),
447449
updateTags: JSON.stringify(newProps.tags) !== JSON.stringify(oldProps.tags),
450+
updateBootstrapSelfManagedAddons: newProps.bootstrapSelfManagedAddons !== oldProps.bootstrapSelfManagedAddons,
448451
};
449452
}
450453

‎packages/@aws-cdk/custom-resource-handlers/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@aws-sdk/client-route-53": "3.421.0",
4343
"@aws-sdk/client-cloudwatch-logs": "3.421.0",
4444
"@aws-sdk/client-dynamodb": "3.421.0",
45-
"@aws-sdk/client-eks": "3.476.0",
45+
"@aws-sdk/client-eks": "3.609.0",
4646
"@aws-sdk/client-sts": "3.421.0",
4747
"@aws-sdk/node-http-handler": "^3.370.0",
4848
"@smithy/util-stream": "^2.2.0",

‎packages/aws-cdk-lib/aws-eks/lib/cluster-resource.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface ClusterResourceProps {
2727
readonly tags?: { [key: string]: string };
2828
readonly logging?: { [key: string]: [ { [key: string]: any } ] };
2929
readonly accessconfig?: CfnCluster.AccessConfigProperty;
30+
readonly bootstrapSelfManagedAddons?: boolean;
3031
}
3132

3233
/**
@@ -90,6 +91,7 @@ export class ClusterResource extends Construct {
9091
tags: props.tags,
9192
logging: props.logging,
9293
accessConfig: props.accessconfig,
94+
bootstrapSelfManagedAddons: props.bootstrapSelfManagedAddons,
9395
},
9496
AssumeRoleArn: this.adminRole.roleArn,
9597

@@ -98,7 +100,7 @@ export class ClusterResource extends Construct {
98100
// doesn't contain XXX key in object" (see #8276) by incrementing this
99101
// number, you will effectively cause a "no-op update" to the cluster
100102
// which will return the new set of attribute.
101-
AttributesRevision: 3,
103+
AttributesRevision: 4,
102104
},
103105
});
104106

‎packages/aws-cdk-lib/aws-eks/lib/cluster.ts

+12
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,17 @@ export interface ClusterProps extends ClusterOptions {
847847
*/
848848
readonly bootstrapClusterCreatorAdminPermissions?: boolean;
849849

850+
/**
851+
* If you set this value to False when creating a cluster, the default networking add-ons will not be installed.
852+
* The default networking addons include vpc-cni, coredns, and kube-proxy.
853+
* Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.
854+
*
855+
* Changing this value after the cluster has been created will result in the cluster being replaced.
856+
*
857+
* @default true
858+
*/
859+
readonly bootstrapSelfManagedAddons?: boolean;
860+
850861
/**
851862
* The tags assigned to the EKS cluster
852863
*
@@ -1696,6 +1707,7 @@ export class Cluster extends ClusterBase {
16961707
onEventLayer: this.onEventLayer,
16971708
tags: props.tags,
16981709
logging: this.logging,
1710+
bootstrapSelfManagedAddons: props.bootstrapSelfManagedAddons,
16991711
});
17001712

17011713
if (this.endpointAccess._config.privateAccess && privateSubnets.length !== 0) {

‎yarn.lock

+2,008-2,341
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.