fix(eks): clear OCI repo/version after local pull for Helm v4 compatibility#37142
Conversation
|
|
||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
d1ec23c to
4a44a59
Compare
4a44a59 to
bbbea41
Compare
…art fixes - Update tests using AL2_x86_64 AMI type to AL2023_x86_64_STANDARD (k8s 1.35 dropped AL2 support) - Pin integ.eks-inference to k8s 1.32 (EksOptimizedImage hardcodes AL2 SSM paths) - Use AL2023_X86_64_NEURON for inference nodegroups - Add service account for ec2-chart in integ.eks-helm-asset (matching eks-v2 pattern) - Add region constraint for integ.eks-inference-nodegroup (inf2.xlarge not in ca-central-1) - Add new integ.eks-default-capacity test to cover defaultCapacity codepath on k8s 1.32
bbbea41 to
798c7bf
Compare
|
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). |
Merge Queue Status
This pull request spent 6 seconds in the queue, with no time running CI. Required conditions to merge
|
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes cdklabs/awscdk-asset-kubectl#2681
Closes #37143
Reason for this change
Helm v4 (bundled in kubectl-v35) changed
LocateChartbehavior: when--repois set, the local path check is skipped entirely and Helm tries to resolve the chart from the repo URL. Previously Helm v3 prioritized local chart paths over--repo(v3.19 source).This caused OCI helm chart deployments to fail with
"failed to perform FetchReference on source: invalid reference"because the CDK handler was passing both a local chart path AND--repo/--versiontohelm upgradeafter pulling the OCI chart locally. Helm v4 no longer falls back to the local path when--repois provided (v4 source).Additionally, EKS dropped AL2 AMI support starting from Kubernetes 1.33. Since the integ test version helpers now dynamically pick the latest K8s version (currently 1.35), all tests using the default AMI type (
AL2_x86_64) orAL2_x86_64_GPUfail with:These tests need to either migrate to AL2023 AMI types or be pinned to k8s 1.32.
Description of changes
Fix OCI helm chart handling (v1 + v2 handlers): Clear
repositoryandversionafter pulling the OCI chart locally, sohelm upgradeonly receives the local chart path without--repo/--version. This is correct for both Helm v3 and v4 since the chart is already at the right version locally.Dynamic K8s version selection in integ test helpers: The
getClusterVersionConfighelper in bothaws-eksandaws-eks-v2integ tests now dynamically picks the latest version from theversionMapinstead of hardcoding it.Helm asset integ tests cover latest and latest-1: Both v1 and v2
integ.eks-helm-asset.tsnow create two stacks — one with the latest K8s version and one with latest-1.Added non-OCI chart coverage: Both helm-asset integ tests now also install a chart from a standard HTTPS Helm repository.
AL2 to AL2023 AMI migration for EKS integ tests (required because AL2 is unsupported from k8s 1.33+):
integ.helm-chart-logging: UsedefaultCapacity: 0+ explicit AL2023 nodegroupinteg.eks-windows-ng: Change Linux nodegroup fromAL2_X86_64toAL2023_X86_64_STANDARDinteg.eks-inference: Pin to k8s 1.32 — the library'sEksOptimizedImageclass hardcodes AL2 SSM paths (amazon-linux-2-gpu/) for GPU/Inferentia/Trainium node types, so AL2023 cannot be used without a library changeinteg.eks-inference-nodegroup: UseAL2023_X86_64_NEURONfor inference nodegroups,AL2023_X86_64_STANDARDfor default capacity, add region constraint (inf2.xlarge not available in ca-central-1)integ.eks-service-account-sdk-call: UsedefaultCapacity: 0+ explicit AL2023 nodegroupinteg.eks-helm-asset(aws-eks): Add service account for ec2-chart (matching aws-eks-v2 pattern, fixes atomic helm install timeout)New
integ.eks-default-capacitytest: Explicit test for thedefaultCapacity > 0codepath, pinned to k8s 1.32 since the CDK library defaults toAL2_x86_64as the first AMI type for x86_64 instances. This ensures the default capacity path remains tested. (Not needed for eks-v2 since it defaults to AUTOMODE which doesn't create a nodegroup.)Describe any new or updated permissions being added
integ.eks-helm-asset(aws-eks): Added OIDC provider + service account withAmazonEC2FullAccessfor ec2-chart (matching existing aws-eks-v2 pattern)Description of how you validated changes
All integ tests deployed and validated successfully locally:
# Tests validated (all SUCCESS): yarn integ \ test/aws-eks/test/integ.eks-bottlerocket-ng.js \ test/aws-eks/test/integ.eks-cluster-handlers-vpc.js \ test/aws-eks/test/integ.eks-cluster-imported.js \ test/aws-eks/test/integ.eks-cluster-private-endpoint.js \ test/aws-eks/test/integ.eks-helm-asset.js \ test/aws-eks/test/integ.eks-inference.js \ test/aws-eks/test/integ.eks-inference-nodegroup.js \ test/aws-eks/test/integ.eks-service-account-sdk-call.js \ test/aws-eks/test/integ.eks-windows-ng.js \ test/aws-eks/test/integ.helm-chart-logging.js \ test/aws-eks/test/integ.eks-default-capacity.js \ test/aws-eks-v2/test/integ.eks-helm-asset.js \ --disable-update-workflow --update-on-failed --force \ --parallel-regions us-east-1 us-west-2 eu-west-1 ap-south-1 ca-central-1 sa-east-1Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license