Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eks): support AL2023 #29550

Closed

Conversation

pahud
Copy link
Contributor

@pahud pahud commented Mar 20, 2024

Turning this PR in to draft in favor of the earlier submitted one #29505

Will close this PR when #29505 is merged.

--

This PR improves the Amazon EKS with Amazon Linux 2023 support that allows the cluster to addNodegroupCapacity() correctly.

To make sure it works with the latest KubernetesVersion 1.29 with Amazon EKS, this PR added a new integration test for for that.

Issue # (if applicable)

Closes #29546

Reason for this change

Description of changes

Description of how you validated changes

class EksClusterStack extends Stack {

  private cluster: eks.Cluster;
  private vpc: ec2.IVpc;

  constructor(scope: App, id: string, props?: StackProps) {
    super(scope, id, props);

    // allow all account users to assume this role in order to admin the cluster
    const mastersRole = new iam.Role(this, 'AdminRole', {
      assumedBy: new iam.AccountRootPrincipal(),
    });

    // just need one nat gateway to simplify the test
    // this.vpc = new ec2.Vpc(this, 'Vpc', { natGateways: 1, restrictDefaultSecurityGroup: false });
    this.vpc = ec2.Vpc.fromLookup(this, 'Vpc', { isDefault: true });

    // create the cluster with a default nodegroup capacity
    this.cluster = new eks.Cluster(this, 'Cluster', {
      vpc: this.vpc,
      mastersRole,
      defaultCapacity: 0,
      ...getClusterVersionConfig(this, eks.KubernetesVersion.V1_29),
    });

    this.cluster.addNodegroupCapacity('NG1', {
      amiType: NodegroupAmiType.AL2023_X86_64_STANDARD,
    });
    this.cluster.addNodegroupCapacity('NG2', {
      amiType: NodegroupAmiType.AL2023_ARM_64_STANDARD,
    });
  }
}
kubectl get no
NAME                           STATUS   ROLES    AGE    VERSION
ip-172-31-1-162.ec2.internal   Ready    <none>   118m   v1.29.0-eks-5e0fdde
ip-172-31-2-177.ec2.internal   Ready    <none>   118m   v1.29.0-eks-5e0fdde
ip-172-31-2-211.ec2.internal   Ready    <none>   118m   v1.29.0-eks-5e0fdde
ip-172-31-3-51.ec2.internal    Ready    <none>   118m   v1.29.0-eks-5e0fdde

List nodes and print architecture, osImage and kubeletVersion only:

kubectl get no --no-headers -o custom-columns=NAME:.metadata.name | while read x; do kubectl get no $x -o jsonpath="{.status.nodeInfo}" | jq -r '{ architecture, osImage, kubeletVersion }'; done
{
  "architecture": "arm64",
  "osImage": "Amazon Linux 2023.3.20240304",
  "kubeletVersion": "v1.29.0-eks-5e0fdde"
}
{
  "architecture": "arm64",
  "osImage": "Amazon Linux 2023.3.20240304",
  "kubeletVersion": "v1.29.0-eks-5e0fdde"
}
{
  "architecture": "amd64",
  "osImage": "Amazon Linux 2023.3.20240304",
  "kubeletVersion": "v1.29.0-eks-5e0fdde"
}
{
  "architecture": "amd64",
  "osImage": "Amazon Linux 2023.3.20240304",
  "kubeletVersion": "v1.29.0-eks-5e0fdde"
}

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p1 labels Mar 20, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team March 20, 2024 11:46
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 20, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@godwingrs22 godwingrs22 self-requested a review March 20, 2024 22:39
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 21, 2024 14:08

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@pahud pahud marked this pull request as ready for review March 21, 2024 14:11
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 723ec56
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 21, 2024
@guessi
Copy link
Contributor

guessi commented Mar 21, 2024

fyi, I did the same fixed #29505 last week, would you mind look into it ?

@pahud
Copy link
Contributor Author

pahud commented Mar 21, 2024

@guessi oh I didn't notice you have submitted a PR for that last week. I will turn my PR into Draft in favor of yours.

@pahud pahud marked this pull request as draft March 21, 2024 14:58
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 21, 2024
@pahud
Copy link
Contributor Author

pahud commented Apr 9, 2024

closed in favor of #29505

@pahud pahud closed this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eks: Amazon Linux 2023 is not fully supported in nodegroup
3 participants