Skip to content

Commit

Permalink
[cdk_infra] Update clusters for EKS Supported Versions (#1447)
Browse files Browse the repository at this point in the history
* Add v27 layer, remove unsupported layers

* Update cluster definitions

* Update tests
  • Loading branch information
bryan-aguilar authored Oct 18, 2023
1 parent 209a44e commit 5a0284a
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 79 deletions.
126 changes: 63 additions & 63 deletions cdk_infra/lib/config/cluster-config/clusters.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,6 @@
---
clusters:
- name: collector-ci-amd64-1-22
version: "1.22"
launch_type: ec2
instance_type: "m5.large"
- name: collector-ci-arm64-1-22
version: "1.22"
launch_type: ec2
instance_type: m6g.large
- name: collector-ci-fargate-1-22
version: "1.22"
launch_type: fargate
- name: operator-ci-amd64-1-22
version: "1.22"
launch_type: ec2
instance_type: m5.large
cert_manager: true
- name: operator-ci-arm64-1-22
version: "1.22"
launch_type: ec2
instance_type: m6g.large
cert_manager: true
- name: collector-ci-arm64-1-23
version: "1.23"
launch_type: ec2
instance_type: m6g.large
- name: collector-ci-amd64-1-23
version: "1.23"
launch_type: ec2
instance_type: "m5.large"
- name: collector-ci-fargate-1-23
version: "1.23"
launch_type: fargate
- name: operator-ci-amd64-1-23
version: "1.23"
launch_type: ec2
instance_type: m5.large
cert_manager: true
- name: operator-ci-arm64-1-23
version: "1.23"
launch_type: ec2
instance_type: m6g.large
cert_manager: true
# collector test clusters
- name: collector-ci-arm64-1-24
version: "1.24"
launch_type: ec2
Expand All @@ -50,11 +9,9 @@ clusters:
version: "1.24"
launch_type: ec2
instance_type: "m5.large"
- name: eks-addon-amd64-1-24
- name: collector-ci-fargate-1-24
version: "1.24"
launch_type: ec2
instance_type: "m5.large"
cert_manager: true
launch_type: fargate
- name: collector-ci-arm64-1-25
version: "1.25"
launch_type: ec2
Expand All @@ -63,6 +20,9 @@ clusters:
version: "1.25"
launch_type: ec2
instance_type: "m5.large"
- name: collector-ci-fargate-1-25
version: "1.25"
launch_type: fargate
- name: collector-ci-arm64-1-26
version: "1.26"
launch_type: ec2
Expand All @@ -71,39 +31,79 @@ clusters:
version: "1.26"
launch_type: ec2
instance_type: "m5.large"
- name: java-instrumentation-operator-ci-amd64-1-23
version: "1.23"
- name: collector-ci-fargate-1-26
version: "1.26"
launch_type: fargate
- name: collector-ci-arm64-1-27
version: "1.27"
launch_type: ec2
instance_type: m6g.large
- name: collector-ci-amd64-1-27
version: "1.27"
launch_type: ec2
instance_type: "m5.large"
- name: collector-ci-fargate-1-27
version: "1.27"
launch_type: fargate
# java agent test clustesr
- name: java-instrumentation-operator-ci-amd64-1-24
version: "1.24"
launch_type: ec2
instance_type: m5.large
cert_manager: true
- name: java-instrumentation-operator-ci-amd64-1-26
version: "1.26"
- name: java-instrumentation-operator-ci-amd64-1-27
version: "1.27"
launch_type: ec2
instance_type: m5.large
cert_manager: true
- name: java-instrumentation-operator-ci-arm64-1-23
version: "1.23"
- name: java-instrumentation-operator-ci-arm64-1-24
version: "1.24"
launch_type: ec2
instance_type: m6g.large
cert_manager: true
- name: java-instrumentation-operator-ci-arm64-1-26
version: "1.26"
- name: java-instrumentation-operator-ci-arm64-1-27
version: "1.27"
launch_type: ec2
instance_type: m6g.large
cert_manager: true
- name: dev-collector-ci-amd64-1-23
version: "1.23"
# operator test clusters
- name: operator-ci-amd64-1-24
version: "1.24"
launch_type: ec2
instance_type: "m5.large"
- name: dev-collector-ci-arm64-1-23
version: "1.23"
instance_type: m5.large
cert_manager: true
- name: operator-ci-arm64-1-24
version: "1.24"
launch_type: ec2
instance_type: m6g.large
- name: dev-collector-ci-arm64-1-26
version: "1.26"
cert_manager: true
- name: operator-ci-amd64-1-25
version: "1.25"
launch_type: ec2
instance_type: m5.large
cert_manager: true
- name: operator-ci-arm64-1-25
version: "1.25"
launch_type: ec2
instance_type: m6g.large
- name: dev-collector-ci-amd64-1-26
cert_manager: true
- name: operator-ci-amd64-1-26
version: "1.26"
launch_type: ec2
instance_type: "m5.large"
instance_type: m5.large
cert_manager: true
- name: operator-ci-arm64-1-26
version: "1.26"
launch_type: ec2
instance_type: m6g.large
cert_manager: true
- name: operator-ci-amd64-1-27
version: "1.27"
launch_type: ec2
instance_type: m5.large
cert_manager: true
- name: operator-ci-arm64-1-27
version: "1.27"
launch_type: ec2
instance_type: m6g.large
cert_manager: true
12 changes: 3 additions & 9 deletions cdk_infra/lib/utils/eks/kubectlLayer.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
import { KubectlV22Layer } from '@aws-cdk/lambda-layer-kubectl-v22';
import { KubectlV23Layer } from '@aws-cdk/lambda-layer-kubectl-v23';
import { KubectlLayer } from '@aws-cdk/lambda-layer-kubectl-v21';
import { aws_eks } from 'aws-cdk-lib';
import { ILayerVersion } from 'aws-cdk-lib/aws-lambda';
import { Construct } from 'constructs/lib/construct';
import { KubectlV24Layer } from '@aws-cdk/lambda-layer-kubectl-v24';
import { KubectlV25Layer } from '@aws-cdk/lambda-layer-kubectl-v25';
import { KubectlV26Layer } from '@aws-cdk/lambda-layer-kubectl-v26';
import { KubectlV27Layer } from '@aws-cdk/lambda-layer-kubectl-v27';

export function GetLayer(
scope: Construct,
k8sVersion: aws_eks.KubernetesVersion
): ILayerVersion {
switch (k8sVersion.version) {
case '1.21':
return new KubectlLayer(scope, 'v21Layer');
case '1.22':
return new KubectlV22Layer(scope, 'v22Layer');
case '1.23':
return new KubectlV23Layer(scope, 'v23Layer');
case '1.24':
return new KubectlV24Layer(scope, 'v24Layer');
case '1.25':
return new KubectlV25Layer(scope, 'v25Layer');
case '1.26':
return new KubectlV26Layer(scope, 'v26Layer');
case '1.27':
return new KubectlV27Layer(scope, 'v27Layer');
default:
throw new Error(`invalid kubernetes version: ${k8sVersion.version}`);
}
Expand Down
2 changes: 1 addition & 1 deletion cdk_infra/lib/utils/eks/validate-interface-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ec2ClusterInterface } from '../../interfaces/eks/ec2cluster-interface';
const validateSchema = require('yaml-schema-validator');

const supportedLaunchTypes = new Set(['fargate', 'ec2']);
const supportedVersions = new Set(['1.22', '1.23', '1.24', '1.25', '1.26']);
const supportedVersions = new Set(['1.24', '1.25', '1.26', '1.27']);
const supportedCPUArchitectures = new Set(['m5', 'm6g', 't4g']);
const supportedNodeSizes = new Set([
'medium',
Expand Down
16 changes: 16 additions & 0 deletions cdk_infra/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cdk_infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.242",
"@aws-cdk/lambda-layer-kubectl-v25": "^2.0.4",
"@aws-cdk/lambda-layer-kubectl-v26": "^2.0.1",
"@aws-cdk/lambda-layer-kubectl-v27": "^2.0.0",
"aws-cdk-lib": "^2.100.0",
"constructs": "^10.3.0",
"js-yaml": "^4.1.0",
Expand Down
12 changes: 6 additions & 6 deletions cdk_infra/test/test_config/test_clusters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ clusters:
- name: m5-amd64-Cluster
launch_type: ec2
instance_type: m5.large
version: "1.22"
version: "1.24"
- name: t4g-arm64-Cluster
launch_type: ec2
instance_type: t4g.large
version: "1.23"
version: "1.24"
- name: m6g-arm64-Cluster
launch_type: ec2
instance_type: m6g.large
version: "1.24"
version: "1.25"
- name: fargateCluster0
launch_type: fargate
version: "1.25"
- name: m6g-arm64-Cluster-1-26
version: "1.26"
- name: m6g-arm64-Cluster-1-27
launch_type: ec2
instance_type: m6g.large
version: "1.26"
version: "1.27"

0 comments on commit 5a0284a

Please sign in to comment.