ripe-shampoo-80285
06/19/2021, 1:52 AM<http://k8s.io/cluster-autoscaler/|k8s.io/cluster-autoscaler/><cluster-name>
owned
<http://k8s.io/cluster-autoscaler/enabledTRUE|k8s.io/cluster-autoscaler/enabledTRUE>
proud-pizza-80589
06/19/2021, 9:20 AMconst cluster = new eks.Cluster(
name,
{
name,
skipDefaultNodeGroup: true,
vpcId: vpc.id,
publicSubnetIds: vpc.publicSubnetIds,
privateSubnetIds: vpc.privateSubnetIds,
nodeAssociatePublicIpAddress: false,
instanceRoles: [role],
userMappings: [
{
/**
* The ARN of the IAM user to add.
*/
userArn: 'arn:aws:iam::xxx:root',
/**
* The user name within Kubernetes to map to the IAM user. By default, the user name is the ARN of the IAM user.
*/
username: 'xxx',
/**
* A list of groups within Kubernetes to which the user is mapped to.
*/
groups: ['system:masters'],
},
],
providerCredentialOpts: {},
},
{
provider: regionProvider,
parent: this,
protect: false,
}
);
eks.createManagedNodeGroup(
`${name}-ng`,
{
cluster: cluster,
nodeGroupName: `${name}`,
nodeRoleArn: role.arn,
instanceTypes: ['t3.xlarge'],
scalingConfig: {
desiredSize: 3,
minSize: 3,
maxSize: 50,
},
labels: {
[`cluster-autoscaler/${name}`]: 'owned',
'cluster-autoscaler/enabled': 'true',
},
},
cluster,
regionProvider
);
billowy-army-68599
06/20/2021, 12:31 PMripe-shampoo-80285
06/20/2021, 6:54 PM