Skip to content

Commit bd449f8

Browse files
authored
chore: add EKS 1.33-1.34 support with AL2023 AMIs (#1811)
* chore: upgrade EKS clusters to support k8s 1.29-1.34, remove 1.27-1.28 * increase concurrency * fix: use AL2023 AMIs for EKS 1.33+ clusters * fix: add retry logic for go mod download
1 parent f87d7d9 commit bd449f8

8 files changed

Lines changed: 36 additions & 9 deletions

File tree

cdk_infra/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.PHONY: deploy-infra
22
deploy-infra:
3-
npm run cdk deploy -- --all --require-approval never --concurrency 4
3+
npm run cdk deploy -- --all --require-approval never --concurrency 8

cdk_infra/lib/cluster-deployment.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,31 @@ export function deployClusters(
5656
if (clusterInterface.launch_type === 'ec2') {
5757
const ec2Cluster = cluster as ec2ClusterInterface;
5858
validateInterface(ec2Cluster);
59+
60+
// Determine AMI type based on Kubernetes version and architecture
61+
// K8s 1.33+ only supports AL2023, earlier versions use AL2
62+
const k8sVersion = parseFloat(clusterInterface.version);
63+
const isArm64 = ec2Cluster.name.match('-arm64-');
64+
let amiType: NodegroupAmiType;
65+
66+
if (k8sVersion >= 1.33) {
67+
amiType = isArm64
68+
? NodegroupAmiType.AL2023_ARM_64_STANDARD
69+
: NodegroupAmiType.AL2023_X86_64_STANDARD;
70+
} else {
71+
amiType = isArm64
72+
? NodegroupAmiType.AL2_ARM_64
73+
: NodegroupAmiType.AL2_X86_64;
74+
}
75+
5976
clusterStack = new EC2Stack(app, `${ec2Cluster.name}EKSCluster`, {
6077
name: ec2Cluster.name,
6178
vpc: vpc,
6279
version: versionKubernetes,
6380
instanceTypes: [
6481
new InstanceType(ec2Cluster.instance_type.toLowerCase())
6582
],
66-
amiType: ec2Cluster.name.match('-arm64-')
67-
? NodegroupAmiType.AL2_ARM_64
68-
: NodegroupAmiType.AL2_X86_64,
83+
amiType: amiType,
6984
env: envInput
7085
});
7186
} else {

cdk_infra/lib/stacks/eks/ec2-cluster-stack.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ function getReleaseVersion(amiType: string, clusterVersion: string, scope: Const
1818
parameterName = `/aws/service/eks/optimized-ami/${clusterVersion}/amazon-linux-2/recommended/release_version`;
1919
} else if (amiType === NodegroupAmiType.AL2_ARM_64) {
2020
parameterName = `/aws/service/eks/optimized-ami/${clusterVersion}/amazon-linux-2-arm64/recommended/release_version`;
21+
} else if (amiType === NodegroupAmiType.AL2023_X86_64_STANDARD) {
22+
parameterName = `/aws/service/eks/optimized-ami/${clusterVersion}/amazon-linux-2023/x86_64/standard/recommended/release_version`;
23+
} else if (amiType === NodegroupAmiType.AL2023_ARM_64_STANDARD) {
24+
parameterName = `/aws/service/eks/optimized-ami/${clusterVersion}/amazon-linux-2023/arm64/standard/recommended/release_version`;
2125
} else {
2226
throw new Error(`Unsupported amiType: ${amiType}`);
2327
}

cdk_infra/lib/stacks/vpc/vpc-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class VPCStack extends Stack {
77
constructor(scope: Construct, id: string, props?: StackProps) {
88
super(scope, id, props);
99
this.vpc = new ec2.Vpc(this, 'EKSVpc', {
10-
cidr: '10.0.0.0/16',
10+
ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
1111
natGateways: 3,
1212
maxAzs: 3,
1313
vpnGateway: false,

mocked_servers/grpc_metrics/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificat
66
WORKDIR $GOPATH/main
77
COPY . .
88
RUN go env -w GOPROXY=direct
9-
RUN GO111MODULE=on go mod download
9+
# Retry logic for go mod download to handle transient network issues
10+
RUN for i in 1 2 3; do GO111MODULE=on go mod download && break || sleep 5; done
1011
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -o=/bin/main .
1112

1213
FROM scratch

mocked_servers/grpc_trace/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificat
66
WORKDIR $GOPATH/main
77
COPY . .
88
RUN go env -w GOPROXY=direct
9-
RUN GO111MODULE=on go mod download
9+
# Retry logic for go mod download to handle transient network issues
10+
RUN for i in 1 2 3; do GO111MODULE=on go mod download && break || sleep 5; done
1011
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -o=/bin/main .
1112

1213
FROM scratch

mocked_servers/https/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
FROM golang:1.23 AS build
2+
3+
# Update CA certificates to fix TLS handshake issues on ARM64
4+
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates && rm -rf /var/lib/apt/lists/*
5+
26
WORKDIR $GOPATH/main
37
COPY . .
48
RUN go env -w GOPROXY=direct
5-
RUN GO111MODULE=on go mod download
9+
# Retry logic for go mod download to handle transient network issues
10+
RUN for i in 1 2 3; do GO111MODULE=on go mod download && break || sleep 5; done
611
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -o=/bin/main .
712

813
FROM scratch

sample-apps/prometheus/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificat
66
WORKDIR $GOPATH/main
77
COPY . .
88
RUN go env -w GOPROXY=direct
9-
RUN GO111MODULE=on go mod download
9+
# Retry logic for go mod download to handle transient network issues
10+
RUN for i in 1 2 3; do GO111MODULE=on go mod download && break || sleep 5; done
1011
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -o=/bin/main .
1112

1213
FROM scratch

0 commit comments

Comments
 (0)