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

feat(eks-v2-alpha): support eks with k8s 1.32 #33344

Merged
merged 7 commits into from
Feb 10, 2025
Merged

Conversation

pahud
Copy link
Contributor

@pahud pahud commented Feb 7, 2025

Issue # (if applicable)

Closes #.

Reason for this change

Description of changes

Describe any new or updated permissions being added

Description of how you validated changes

import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as iam from 'aws-cdk-lib/aws-iam';
import { App, Stack, StackProps } from 'aws-cdk-lib';
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
import * as eks from '../lib';
import { Construct } from 'constructs';

export class EksClusterLatestVersion extends Stack {
  constructor(scope: Construct, id: string, props: StackProps) {
    super(scope, id, props);

    const vpc = new ec2.Vpc(this, 'Vpc', { natGateways: 1 });
    const mastersRole = new iam.Role(this, 'Role', {
      assumedBy: new iam.AccountRootPrincipal(),
    });

    new eks.Cluster(this, 'hello-eks', {
      vpc,
      mastersRole,
      version: eks.KubernetesVersion.V1_32,
      kubectlProviderOptions: {
        kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
      },
    });
  }
}

const app = new App();

new EksClusterLatestVersion(app, 'v32-stack', {
  env: {
    account: process.env.CDK_DEFAULT_ACCOUNT,
    region: process.env.CDK_DEFAULT_REGION,
  },
});

app.synth();

verify:

 % kubectl get no
NAME                          STATUS   ROLES    AGE   VERSION
ip-172-31-1-32.ec2.internal   Ready    <none>   10m   v1.32.0-eks-aeac579
ip-172-31-2-70.ec2.internal   Ready    <none>   10m   v1.32.0-eks-aeac579
pahud@MBP @aws-cdk % kubectl get po -n kube-system
NAME                       READY   STATUS    RESTARTS        AGE
aws-node-6lp5b             2/2     Running   2 (8m33s ago)   11m
aws-node-tckj8             2/2     Running   2 (8m47s ago)   11m
coredns-6b9575c64c-pntcb   1/1     Running   1 (8m33s ago)   15m
coredns-6b9575c64c-zsqw8   1/1     Running   1 (8m33s ago)   15m
kube-proxy-q7744           1/1     Running   1 (8m32s ago)   11m
kube-proxy-tfrmc           1/1     Running   1 (8m47s ago)   11m

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 the p2 label Feb 7, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 7, 2025 21:26
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 7, 2025
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.

(This review is outdated)

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.92%. Comparing base (4e71675) to head (8fd5b82).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33344   +/-   ##
=======================================
  Coverage   80.92%   80.92%           
=======================================
  Files         236      236           
  Lines       14256    14256           
  Branches     2491     2491           
=======================================
  Hits        11537    11537           
  Misses       2434     2434           
  Partials      285      285           
Flag Coverage Δ
suite.unit 80.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 79.74% <ø> (ø)
packages/aws-cdk-lib/core 82.20% <ø> (ø)

@aws-cdk-automation aws-cdk-automation dismissed their stale review February 8, 2025 03:45

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

@pahud pahud marked this pull request as ready for review February 8, 2025 12:51
Copy link
Contributor

@xazhao xazhao left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

mergify bot commented Feb 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Feb 10, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@aws aws deleted a comment from mergify bot Feb 10, 2025
@pahud
Copy link
Contributor Author

pahud commented Feb 10, 2025

As a reference, the action plan I used for this PR.
# feat(eks-v2-alpha): support eks with k8s 1.32

Issue

Similar to PR #33339 which adds 1.32 support for aws-eks v1 module, this PR adds Kubernetes 1.32 support for the aws-eks-v2-alpha module.

Action Plan

  1. Update KubernetesVersion enum

    • Add V1_32 version to the KubernetesVersion enum
    • Update relevant version-related constants and interfaces
  2. Add kubectl v1.32 layer support

    • Add @aws-cdk/lambda-layer-kubectl-v32 as a devDependency
    • Update relevant kubectl layer imports and examples
  3. Update tests

    • Add new test cases for v1.32 support
    • Update existing test cases that reference version lists
    • Ensure all integration tests pass with v1.32
  4. Update documentation

    • Update code examples in README.md to include v1.32 option
    • Update any version-specific documentation
  5. Dependencies

    • Add @aws-cdk/lambda-layer-kubectl-v32 to package.json devDependencies
    • Update any version-dependent peer dependencies if needed

Testing Plan

  1. Unit Tests

    • Test KubernetesVersion enum includes v1.32
    • Test version validation logic works with v1.32
    • Test kubectl layer selection works correctly for v1.32
  2. Integration Tests

    • Test cluster creation with v1.32
    • Test kubectl operations with v1.32
    • Test managed node groups with v1.32
    • Test Fargate profiles with v1.32

Documentation Updates

  1. README.md

    • Update examples to show v1.32 usage
    • Update any version-specific notes or warnings
  2. API Documentation

    • Update KubernetesVersion enum documentation
    • Update any version-related interface documentation

Validation

  • All unit tests pass
  • All integration tests pass
  • Documentation is updated
  • Examples work with v1.32
  • Package builds successfully
  • Manual testing of key scenarios completed

Related

Copy link
Contributor

mergify bot commented Feb 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Feb 10, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@paulhcsun
Copy link
Contributor

@Mergifyio update

Copy link
Contributor

mergify bot commented Feb 10, 2025

update

☑️ Nothing to do

  • #commits-behind > 0 [📌 update requirement]
  • -closed [📌 update requirement]
  • -conflict [📌 update requirement]
  • queue-position = -1 [📌 update requirement]

Copy link
Contributor

mergify bot commented Feb 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit 7175a04 into aws:main Feb 10, 2025
20 checks passed
Copy link
Contributor

mergify bot commented Feb 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants