diff --git a/README.md b/README.md index 49f215fc9..2fac3c82f 100644 --- a/README.md +++ b/README.md @@ -44,14 +44,14 @@ aws --version Install CDK matching the current version of the Blueprints QuickStart (which can be found in package.json). ```bash -npm install -g aws-cdk@2.131.0 +npm install -g aws-cdk@2.132.0 ``` Verify the installation. ```bash cdk --version -# must output 2.131.0 +# must output 2.132.0 ``` Create a new CDK project. We use `typescript` for this example. diff --git a/docs/README.md b/docs/README.md index 01498cc73..b879bbda0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -44,14 +44,14 @@ aws --version Install CDK matching the current version of the Blueprints QuickStart (which can be found in package.json). ```bash -npm install -g aws-cdk@2.131.0 +npm install -g aws-cdk@2.132.0 ``` Verify the installation. ```bash cdk --version -# must output 2.131.0 +# must output 2.132.0 ``` Create a new CDK project. We use `typescript` for this example. diff --git a/docs/addons/gmaestro.md b/docs/addons/gmaestro.md index 0f58c9d28..83a6a52d5 100644 --- a/docs/addons/gmaestro.md +++ b/docs/addons/gmaestro.md @@ -1,6 +1,6 @@ # gMaestro add-on for Amazon EKS Blueprints -This add-on deploys the [gMaestro Agent](https://gmaestro.gitbook.io/gmaestro-docs/) on Amazon EKS using the [eks-blueprints](https://github.com/aws-quickstart/cdk-eks-blueprints) [CDK](https://aws.amazon.com/cdk/) construct. +This add-on deploys the [gMaestro Agent](https://app.granulate.io/gMaestroSignup) on Amazon EKS using the [eks-blueprints](https://github.com/aws-quickstart/cdk-eks-blueprints) [CDK](https://aws.amazon.com/cdk/) construct. gMaestro is a Kubernetes cost optimization solution that helps companies reduce spending on un-utilized resources by up to 60%. With gMaestro, you gain full visibility into K8s clusters, seamlessly interact with HPA scaling policies, and achieve your cost-performance goals by applying custom rightsizing recommendations based on actual usage in production. diff --git a/docs/getting-started.md b/docs/getting-started.md index f9e2f5e96..6a4b6696a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -26,21 +26,52 @@ Create a directory that represents you project (e.g. `my-blueprints`) and then c ```bash npm install -g n # may require sudo n stable # may require sudo -npm install -g aws-cdk@2.131.0 # may require sudo (Ubuntu) depending on configuration -cdk --version # must produce 2.131.0 +npm install -g aws-cdk@2.132.0 # may require sudo (Ubuntu) depending on configuration +cdk --version # must produce 2.132.0 mkdir my-blueprints cd my-blueprints cdk init app --language typescript ``` -## Configure and Deploy EKS Clusters -Install the `eks-blueprints` NPM package via the following. +## Configure Your Project + +Install the `eks-blueprints` NPM package (keep reading if you get an error or warning message): ```bash npm i @aws-quickstart/eks-blueprints ``` -Replace the contents of `bin/.ts` (where `your-main-file` by default is the name of the root project directory) with the following code. This code will deploy a new EKS Cluster and install the `ArgoCD` addon. +CDK version of the EKS Blueprints is pinned as [`peerDependencies`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependencies) to the version that we tested against to minimize the risk of incompatibilities and/or broken functionality. When running the install command, NPM will detect any mismatch in the version and issue an error. For example: + +``` +npm ERR! code ERESOLVE +npm ERR! ERESOLVE unable to resolve dependency tree +npm ERR! +npm ERR! While resolving: my-blueprint@0.1.0 +npm ERR! Found: aws-cdk-lib@2.130.0 +npm ERR! node_modules/aws-cdk-lib +npm ERR! aws-cdk-lib@"2.130.0" from the root project +npm ERR! +npm ERR! Could not resolve dependency: +npm ERR! peer bundled aws-cdk-lib@"2.132.0" from @aws-quickstart/eks-blueprints@1.14.0 +npm ERR! node_modules/@aws-quickstart/eks-blueprint +``` + +This message means that the version of CDK that the customer is using is different from the version of CDK used in EKS Blueprints. Locate the line `peer bundled` and check the expected version of the CDK. Make sure that in your `package.json` the version is set to the expected. In this example, `package.json` contained `"aws-cdk-lib": "2.130.0"`, while the expected version was `2.132.0`. + +**Note**: after the initial installation, upgrading the version of CDK to an incompatible higher/lower version will produce a warning, but will succeed. For community support (submitting GitHub issues) please make sure you have a matching version configured. + +Example warning: + +``` +npm WARN +npm WARN Could not resolve dependency: +npm WARN peer bundled aws-cdk-lib@"2.132.0" from @aws-quickstart/eks-blueprints@1.14.0 +``` + +## Deploy EKS Clusters + +Replace the contents of `bin/.ts` (where `your-main-file` by default is the name of the root project directory) with the following code. This code will deploy a new EKS Cluster and install a number of addons. ```typescript import * as cdk from 'aws-cdk-lib'; @@ -51,6 +82,8 @@ const account = 'XXXXXXXXXXXXX'; const region = 'us-east-2'; const version = 'auto'; +blueprints.HelmAddOn.validateHelmVersions = true; // optional if you would like to check for newer versions + const addOns: Array = [ new blueprints.addons.ArgoCDAddOn(), new blueprints.addons.CalicoOperatorAddOn(), diff --git a/docs/internal/ci.md b/docs/internal/ci.md index bbae4eb84..ff38b1b0a 100644 --- a/docs/internal/ci.md +++ b/docs/internal/ci.md @@ -19,7 +19,7 @@ cd cdk-eks-blueprints Install CDK (please review and install any missing [pre-requisites](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html) for your environment) ```sh -npm install -g aws-cdk@2.131.0 +npm install -g aws-cdk@2.132.0 ``` Install the dependencies for this project. diff --git a/examples/blueprint-construct/index.ts b/examples/blueprint-construct/index.ts index acd86dd8b..3b5b00b36 100644 --- a/examples/blueprint-construct/index.ts +++ b/examples/blueprint-construct/index.ts @@ -243,7 +243,7 @@ export default class BlueprintConstruct { }); const clusterProvider = new blueprints.GenericClusterProvider({ - version: KubernetesVersion.V1_28, + version: KubernetesVersion.V1_29, tags: { "Name": "blueprints-example-cluster", "Type": "generic-cluster" diff --git a/examples/examples.ts b/examples/examples.ts index bc9773b1c..29f277c98 100644 --- a/examples/examples.ts +++ b/examples/examples.ts @@ -46,10 +46,6 @@ builder() .addOns(buildArgoBootstrap()) .build(app, 'argo-blueprint1'); -builder() - .clusterProvider(new bp.MngClusterProvider(publicCluster)) - .addOns(buildFluxBootstrap()) - .build(app, 'flux-blueprint'); function buildArgoBootstrap() { @@ -87,18 +83,3 @@ function buildArgoBootstrap() { } }); } - -function buildFluxBootstrap() { - return new bp.addons.FluxCDAddOn({ - bootstrapRepo : { - repoUrl: 'https://github.com/stefanprodan/podinfo', - name: "podinfo", - targetRevision: "master", - path: "./kustomize", - }, - bootstrapValues: { - "region": "us-east-1" - }, - }); -} - diff --git a/lib/addons/karpenter/index.ts b/lib/addons/karpenter/index.ts index 8cdff48ef..f0e066791 100644 --- a/lib/addons/karpenter/index.ts +++ b/lib/addons/karpenter/index.ts @@ -469,6 +469,10 @@ export class KarpenterAddOn extends HelmAddOn { karpenterChart.node.addDependency(ns); + if(clusterInfo.nodeGroups) { + clusterInfo.nodeGroups.forEach(n => karpenterChart.node.addDependency(n)); + } + // Deploy Provisioner (Alpha) or NodePool (Beta) CRD based on the Karpenter Version if (this.options.nodePoolSpec){ let pool; diff --git a/lib/pipelines/code-pipeline.ts b/lib/pipelines/code-pipeline.ts index 662496c86..b293f2ddb 100644 --- a/lib/pipelines/code-pipeline.ts +++ b/lib/pipelines/code-pipeline.ts @@ -457,7 +457,7 @@ class CodePipeline { primaryOutputDirectory: `${path}/cdk.out`, installCommands: [ 'n stable', - 'npm install -g aws-cdk@2.131.0', + 'npm install -g aws-cdk@2.132.0', `cd $CODEBUILD_SRC_DIR/${path} && npm install` ], commands: [`cd $CODEBUILD_SRC_DIR/${path}`, 'npm run build', 'npx cdk synth ' + app] diff --git a/package.json b/package.json index 5c475b5a5..2be3ad139 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "@types/uuid": "^9.0.7", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", - "aws-cdk": "2.131.0", "copyfiles": "^2.4.1", "eslint": "^8.55.0", "jest": "^29.7.0", @@ -47,7 +46,6 @@ "@types/bcrypt": "^5.0.2", "@types/lodash.clonedeep": "^4.5.9", "@types/uuid": "^9.0.7", - "aws-cdk-lib": "2.131.0", "bcrypt": "^5.1.1", "constructs": "^10.3.0", "dot-object": "^2.1.4", @@ -72,5 +70,9 @@ }, "overrides": { "semver": "^7.6.0" + }, + "peerDependencies": { + "aws-cdk-lib": "2.132.0", + "aws-cdk": "2.132.0" } }