Skip to content

Commit

Permalink
chore(eks): Remove legacy and deprecated code (#12189)
Browse files Browse the repository at this point in the history
Removing `LegacyCluster` and the `kubectlEnabled` property.

Closes #11929

BREAKING CHANGE: `LegacyCluster` was removed since it existed only for a transition period to allow gradual migration to the current cluster class.

- eks: `kubectlEnabled` property was removed, all clusters now support `kubectl`. 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
iliapolo authored Dec 22, 2020
1 parent ab5a383 commit 6a20e61
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 2,378 deletions.
30 changes: 0 additions & 30 deletions packages/@aws-cdk/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,28 +583,6 @@ export class EndpointAccess {
* Common configuration props for EKS clusters.
*/
export interface ClusterProps extends ClusterOptions {
/**
* NOT SUPPORTED: We no longer allow disabling kubectl-support. Setting this
* option to `false` will throw an error.
*
* To temporary allow you to retain existing clusters created with
* `kubectlEnabled: false`, you can use `eks.LegacyCluster` class, which is a
* drop-in replacement for `eks.Cluster` with `kubectlEnabled: false`.
*
* Bear in mind that this is a temporary workaround. We have plans to remove
* `eks.LegacyCluster`. If you have a use case for using `eks.LegacyCluster`,
* please add a comment here https://github.com/aws/aws-cdk/issues/9332 and
* let us know so we can make sure to continue to support your use case with
* `eks.Cluster`. This issue also includes additional context into why this
* class is being removed.
*
* @deprecated `eks.LegacyCluster` is __temporarily__ provided as a drop-in
* replacement until you are able to migrate to `eks.Cluster`.
*
* @see https://github.com/aws/aws-cdk/issues/9332
* @default true
*/
readonly kubectlEnabled?: boolean;

/**
* Number of instances to allocate as an initial capacity for this cluster.
Expand Down Expand Up @@ -976,14 +954,6 @@ export class Cluster extends ClusterBase {
physicalName: props.clusterName,
});

if (props.kubectlEnabled === false) {
throw new Error(
'The "eks.Cluster" class no longer allows disabling kubectl support. ' +
'As a temporary workaround, you can use the drop-in replacement class `eks.LegacyCluster`, ' +
'but bear in mind that this class will soon be removed and will no longer receive additional ' +
'features or bugfixes. See https://github.com/aws/aws-cdk/issues/9332 for more details');
}

const stack = Stack.of(this);

this.prune = props.prune ?? true;
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-eks/lib/fargate-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class FargateCluster extends Cluster {
super(scope, id, {
...props,
defaultCapacity: 0,
kubectlEnabled: true,
coreDnsComputeType: props.coreDnsComputeType ?? CoreDnsComputeType.FARGATE,
version: props.version,
});
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-eks/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from './aws-auth';
export * from './aws-auth-mapping';
export * from './cluster';
export * from './legacy-cluster';
export * from './eks.generated';
export * from './fargate-profile';
export * from './helm-chart';
Expand Down
Loading

0 comments on commit 6a20e61

Please sign in to comment.