Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit 2195763

Browse files
lmouhibvgkowski
andauthored
fix: add parameter for autoscaler on emr-eks-cluster.ts (#397)
Co-authored-by: Vincent Gromakowski <vgkowski@users.noreply.github.com>
1 parent 684a62d commit 2195763

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

core/API.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7086,6 +7086,7 @@ const emrEksClusterProps: EmrEksClusterProps = { ... }
70867086
| **Name** | **Type** | **Description** |
70877087
| --- | --- | --- |
70887088
| <code><a href="#aws-analytics-reference-architecture.EmrEksClusterProps.property.eksAdminRoleArn">eksAdminRoleArn</a></code> | <code>string</code> | Amazon IAM Role to be added to Amazon EKS master roles that will give access to kubernetes cluster from AWS console UI. |
7089+
| <code><a href="#aws-analytics-reference-architecture.EmrEksClusterProps.property.autoscalerVersion">autoscalerVersion</a></code> | <code>number</code> | The version of autoscaler to pass to Helm. |
70897090
| <code><a href="#aws-analytics-reference-architecture.EmrEksClusterProps.property.defaultNodeGroups">defaultNodeGroups</a></code> | <code>boolean</code> | If set to true construct will create default EKS nodegroups. |
70907091
| <code><a href="#aws-analytics-reference-architecture.EmrEksClusterProps.property.eksClusterName">eksClusterName</a></code> | <code>string</code> | Name of the Amazon EKS cluster to be created. |
70917092
| <code><a href="#aws-analytics-reference-architecture.EmrEksClusterProps.property.eksVpcAttributes">eksVpcAttributes</a></code> | <code>aws-cdk-lib.aws_ec2.VpcAttributes</code> | Attributes of the VPC where to deploy the EKS cluster VPC should have at least two private and public subnets in different Availability Zones All private subnets should have the following tags: 'for-use-with-amazon-emr-managed-policies'='true' 'kubernetes.io/role/internal-elb'='1' All public subnets should have the following tag: 'kubernetes.io/role/elb'='1'. |
@@ -7106,6 +7107,19 @@ Amazon IAM Role to be added to Amazon EKS master roles that will give access to
71067107

71077108
---
71087109

7110+
##### `autoscalerVersion`<sup>Optional</sup> <a name="autoscalerVersion" id="aws-analytics-reference-architecture.EmrEksClusterProps.property.autoscalerVersion"></a>
7111+
7112+
```typescript
7113+
public readonly autoscalerVersion: number;
7114+
```
7115+
7116+
- *Type:* number
7117+
- *Default:* version matching the default Kubernete version
7118+
7119+
The version of autoscaler to pass to Helm.
7120+
7121+
---
7122+
71097123
##### `defaultNodeGroups`<sup>Optional</sup> <a name="defaultNodeGroups" id="aws-analytics-reference-architecture.EmrEksClusterProps.property.defaultNodeGroups"></a>
71107124

71117125
```typescript

core/package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/emr-eks-platform/emr-eks-cluster.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: MIT-0
33

44
import { join } from 'path';
5+
import { Aws, CfnOutput, CustomResource, Duration, Fn, Stack, Tags, RemovalPolicy, CfnJson } from 'aws-cdk-lib';
56
import { FlowLogDestination, IVpc, SubnetType, Vpc, VpcAttributes } from 'aws-cdk-lib/aws-ec2';
67
import {
78
CapacityType,
@@ -27,27 +28,26 @@ import {
2728
import { LogGroup, RetentionDays } from 'aws-cdk-lib/aws-logs';
2829
import { Bucket, BucketEncryption, Location } from 'aws-cdk-lib/aws-s3';
2930
import { BucketDeployment, Source } from 'aws-cdk-lib/aws-s3-deployment';
30-
import { Aws, CfnOutput, CustomResource, Duration, Fn, Stack, Tags, RemovalPolicy, CfnJson } from 'aws-cdk-lib';
31+
import { Construct } from 'constructs';
32+
import * as SimpleBase from 'simple-base';
3133
import { AraBucket } from '../ara-bucket';
34+
import { ContextOptions } from '../common/context-options';
35+
import { TrackedConstruct, TrackedConstructProps } from '../common/tracked-construct';
3236
import { SingletonKey } from '../singleton-kms-key';
3337
import { SingletonCfnLaunchTemplate } from '../singleton-launch-template';
3438
import { validateSchema } from './config-override-schema-validation';
3539
import { EmrEksNodegroup, EmrEksNodegroupOptions } from './emr-eks-nodegroup';
3640
import { EmrEksNodegroupAsgTagProvider } from './emr-eks-nodegroup-asg-tag';
3741
import { EmrManagedEndpointOptions, EmrManagedEndpointProvider } from './emr-managed-endpoint';
3842
import { EmrVirtualClusterOptions } from './emr-virtual-cluster';
39-
import * as SimpleBase from 'simple-base';
4043
import * as configOverrideSchema from './resources/k8s/emr-eks-config/config-override-schema.json';
4144
import * as CriticalDefaultConfig from './resources/k8s/emr-eks-config/critical.json';
4245
import * as NotebookDefaultConfig from './resources/k8s/emr-eks-config/notebook.json';
4346
import * as SharedDefaultConfig from './resources/k8s/emr-eks-config/shared.json';
4447
import * as IamPolicyAlb from './resources/k8s/iam-policy-alb.json';
4548
import * as K8sRoleBinding from './resources/k8s/rbac/emr-containers-role-binding.json';
4649
import * as K8sRole from './resources/k8s/rbac/emr-containers-role.json';
47-
import { ContextOptions } from '../common/context-options';
48-
import { TrackedConstruct, TrackedConstructProps } from '../common/tracked-construct';
4950

50-
import { Construct } from 'constructs';
5151

5252
/**
5353
* The properties for the EmrEksCluster Construct class.
@@ -92,6 +92,12 @@ export interface EmrEksClusterProps {
9292
* @default - true
9393
*/
9494
readonly defaultNodeGroups?: boolean;
95+
96+
/**
97+
* The version of autoscaler to pass to Helm
98+
* @default - version matching the default Kubernete version
99+
*/
100+
readonly autoscalerVersion?: number;
95101
}
96102

97103
/**
@@ -318,7 +324,7 @@ export class EmrEksCluster extends TrackedConstruct {
318324
this.eksCluster.addHelmChart('AutoScaler', {
319325
chart: 'cluster-autoscaler',
320326
repository: 'https://kubernetes.github.io/autoscaler',
321-
version: '9.11.0',
327+
version: props.autoscalerVersion ? props.autoscalerVersion.toString() : '9.11.0',
322328
namespace: 'kube-system',
323329
timeout: Duration.minutes(14),
324330
values: {

core/yarn.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)