Skip to content

Commit

Permalink
Added support for 1.31 and default EKS/k8s version is set to 1.30
Browse files Browse the repository at this point in the history
  • Loading branch information
shapirov103 committed Oct 21, 2024
1 parent 8547bb8 commit eea9047
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/blueprint-construct/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default class BlueprintConstruct {

export function getClusterProvider(managedNodeGroups: ManagedNodeGroup[]){
return new blueprints.GenericClusterProvider({
version: KubernetesVersion.V1_29,
version: KubernetesVersion.V1_30,
tags: {
"Name": "blueprints-example-cluster",
"Type": "generic-cluster"
Expand Down
13 changes: 5 additions & 8 deletions lib/cluster-providers/generic-cluster-provider.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

import { KubectlV23Layer } from "@aws-cdk/lambda-layer-kubectl-v23";
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";
import { KubectlV28Layer } from "@aws-cdk/lambda-layer-kubectl-v28";
import { KubectlV29Layer } from "@aws-cdk/lambda-layer-kubectl-v29";
import { KubectlV30Layer } from "@aws-cdk/lambda-layer-kubectl-v30";
import { KubectlV31Layer } from "@aws-cdk/lambda-layer-kubectl-v31";

import { Tags } from "aws-cdk-lib";
import * as autoscaling from 'aws-cdk-lib/aws-autoscaling';
Expand Down Expand Up @@ -34,10 +33,6 @@ export function clusterBuilder() {
*/
export function selectKubectlLayer(scope: Construct, version: eks.KubernetesVersion): ILayerVersion | undefined {
switch(version.version) {
case "1.23":
return new KubectlV23Layer(scope, "kubectllayer23");
case "1.24":
return new KubectlV24Layer(scope, "kubectllayer24");
case "1.25":
return new KubectlV25Layer(scope, "kubectllayer25");
case "1.26":
Expand All @@ -50,13 +45,15 @@ export function selectKubectlLayer(scope: Construct, version: eks.KubernetesVers
return new KubectlV29Layer(scope, "kubectllayer29");
case "1.30":
return new KubectlV30Layer(scope, "kubectllayer30");
case "1.31":
return new KubectlV31Layer(scope, "kubectllayer30");

}

const minor = version.version.split('.')[1];

if(minor && parseInt(minor, 10) > 30) {
return new KubectlV30Layer(scope, "kubectllayer30"); // for all versions above 1.30 use 1.30 kubectl (unless explicitly supported in CDK)
if(minor && parseInt(minor, 10) > 31) {
return new KubectlV30Layer(scope, "kubectllayer31"); // for all versions above 1.30 use 1.30 kubectl (unless explicitly supported in CDK)
}
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/stacks/eks-blueprint-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ArgoGitOpsFactory } from "../addons/argocd/argo-gitops-factory";

import * as eks from "aws-cdk-lib/aws-eks";
/* Default K8s version of EKS Blueprints */
export const DEFAULT_VERSION = KubernetesVersion.V1_29;
export const DEFAULT_VERSION = KubernetesVersion.V1_30;

/**
* Exporting control plane log type so that customers don't have to import CDK EKS module for blueprint configuration.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@aws-cdk/lambda-layer-kubectl-v28": "^2.2.0",
"@aws-cdk/lambda-layer-kubectl-v29": "^2.1.0",
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.0",
"@aws-cdk/lambda-layer-kubectl-v31": "^2.0.0",
"@aws-sdk/client-eks": "^3.529.1",
"@aws-sdk/client-secrets-manager": "^3.529.1",
"@types/assert": "^1.5.10",
Expand Down

0 comments on commit eea9047

Please sign in to comment.