[aws-eks] EKS nodes are wrongly configured to use max pods
:bug: Bug Report
What is the problem?
Adding capacity to EKS cluster generates autoscaling groups where instances are launched from launch configuration with user data that launch EKS bootstrap script with wrong arguments. The generated user data looks like that:
#!/bin/bash
set -o xtrace
/etc/eks/bootstrap.sh DevEksCluster --use-max-pods 29
The use of --use-max-pods argument is wrong because it is a boolean flag according to code of the bootstrap script:
https://github.com/awslabs/amazon-eks-ami/blob/5335ea8226636a9a71e378aec115429815084c6e/files/bootstrap.sh#L19
The argument should be totally omitted because is set to true by default and the boostrap script sets the correct max-pods by itself which can be seen in the code above:
https://github.com/awslabs/amazon-eks-ami/blob/5335ea8226636a9a71e378aec115429815084c6e/files/bootstrap.sh#L189-L199
So setting the argument to anything but true results in kubelet using some kind of default value which is 110 in our case and it's totally wrong.
CDK generates the user data always and the only way to do it right is to use escape hatch mechanism to remove the incorrect usage of --use-max-pods argument.
https://github.com/aws/aws-cdk/blob/4a4e1f3c02a2f650de1872765319288cd518bfc5/packages/%40aws-cdk/aws-eks/lib/cluster.ts#L485-L488
Reproduction Steps
- Create EKS cluster ( version 1.12 ) and add capacity to it.
- Notice that user data contains wrong usage of bootstrap script's arguments.
- CDK CLI Version: 1.4.0
- Module Version: 1.4.0
- OS: all
- Language: all
- EKS version: 1.12
On it. Thanks for the report.