Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed tests, build issues, upgraded CDK and libs #1084

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"ghcr.io/devcontainers/features/aws-cli:1": {},
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
"version": "2.147.3"
"version": "2.161.1"
}
},
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linkcheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
{ "pattern": "http://console-eks.yourdomain.com" },
{ "pattern": "https://p191.p3.n0.cdn.getcloudapp.com"},
{ "pattern": "https://rafay.co/"},
{ "pattern": "https://grafana-operator.github.io/grafana-operator/docs/installation/helm"}
{ "pattern": "https://grafana-operator.github.io/grafana-operator/docs/installation/helm"},
{ "pattern": "https://hackerone.com/newrelic"}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,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.147.3
npm install -g aws-cdk@2.161.1
```

Verify the installation.

```bash
cdk --version
# must output 2.147.3
# must output 2.161.1
```

Create a new CDK project. We use `typescript` for this example.
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.147.3
npm install -g aws-cdk@2.161.1
```

Verify the installation.

```bash
cdk --version
# must output 2.147.3
# must output 2.161.1
```

Create a new CDK project. We use `typescript` for this example.
Expand Down
2 changes: 2 additions & 0 deletions docs/addons/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ The framework currently supports the following add-ons.
| [`XrayAdotAddOn`](./xray-adot-addon.md) | Deploys ADOT Collector for Xray to receive traces from your workloads. | ✅ | ✅ |
| [`GmaestroAddOn`](./gmaestro.md) | Adds [gMaestro](https://app.granulate.io/gMaestroSignup) cost optimization solution for EKS cluster. |
| [`EksPodIdentityAgentAddOn`](./eks-pod-identity-agent.md) | [Setting up the EKS Pod Identity Agent](https://docs.aws.amazon.com/en_ca/eks/latest/userguide/pod-id-agent-setup.html) | ✅ | ✅ |


# Standard Helm Add-On Configuration Options

Many add-ons leverage helm to provision and maintain deployments. All provided add-ons that leverage helm allow specifying the following add-on attributes:
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ 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.147.3 # may require sudo (Ubuntu) depending on configuration
cdk --version # must produce 2.147.3
npm install -g aws-cdk@2.161.1 # may require sudo (Ubuntu) depending on configuration
cdk --version # must produce 2.161.1
mkdir my-blueprints
cd my-blueprints
cdk init app --language typescript
Expand Down Expand Up @@ -57,7 +57,7 @@ npm ERR! peer bundled aws-cdk-lib@"2.133.0" from @aws-quickstart/eks-blueprints@
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.133.0"`, while the expected version was `2.147.3`.
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.133.0"`, while the expected version was `2.161.1`.

**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.

Expand Down
2 changes: 1 addition & 1 deletion docs/internal/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.147.3
npm install -g aws-cdk@2.161.1
```

Install the dependencies for this project.
Expand Down
9 changes: 4 additions & 5 deletions lib/addons/cloud-watch-insights/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import {KubernetesVersion} from "aws-cdk-lib/aws-eks";
// aws eks describe-addon-versions --kubernetes-version <kubernetes-version> --addon-name amazon-cloudwatch-observability \
// --query 'addons[].addonVersions[].{Version: addonVersion, Defaultversion: compatibilities[0].defaultVersion}' --output table
const versionMap: Map<KubernetesVersion, string> = new Map([
[KubernetesVersion.V1_30, "v1.10.0-eksbuild.2"],
[KubernetesVersion.V1_29, "v1.10.0-eksbuild.2"],
[KubernetesVersion.V1_28, "v1.10.0-eksbuild.2"],
[KubernetesVersion.V1_27, "v1.10.0-eksbuild.2"],
[KubernetesVersion.V1_26, "v1.10.0-eksbuild.2"],
[KubernetesVersion.V1_30, "v2.1.2-eksbuild.1"],
[KubernetesVersion.V1_29, "v2.1.2-eksbuild.1"],
[KubernetesVersion.V1_28, "v2.1.2-eksbuild.1"],
[KubernetesVersion.V1_27, "v2.1.2-eksbuild.1"]
]);


Expand Down
4 changes: 2 additions & 2 deletions lib/addons/core-addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ export class CoreAddOn implements ClusterAddOn {

provideDefaultAutoVersion(version: KubernetesVersion) : string {
const versionMap = this.coreAddOnProps.versionMap;
if (versionMap) {
return versionMap.get(version) ?? versionMap.values().next().value;
if (versionMap && versionMap.size > 0) {
return versionMap.get(version) ?? versionMap.values().next().value!;
}
throw new Error(`No default version found for add-on ${this.coreAddOnProps.addOnName}`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pipelines/code-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ class CodePipeline {
primaryOutputDirectory: `${path}/cdk.out`,
installCommands: [
'n stable',
'npm install -g aws-cdk@2.147.3',
'npm install -g aws-cdk@2.161.1',
`cd $CODEBUILD_SRC_DIR/${path} && npm install`
],
commands: [`cd $CODEBUILD_SRC_DIR/${path}`, 'npm run build', 'npx cdk synth ' + app]
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"@types/dot-object": "^2.1.6",
"@types/jest": "^29.5.11",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.11.25",
"@types/node": "^22.7.5",
"@types/semver": "^7.5.6",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"copyfiles": "^2.4.1",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"json-schema-to-typescript": "^14.0.5",
"json-schema-to-typescript": "^15.0.2",
"lint": "^1.1.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
Expand Down Expand Up @@ -59,7 +59,7 @@
"ts-deepmerge": "^7.0.0",
"ts-md5": "^1.3.1",
"tslog": "^4.9.2",
"uuid": "^9.0.1",
"uuid": "^10.0.0",
"yaml": "^2.4.1",
"zod": "^3.22.4"
},
Expand All @@ -73,7 +73,7 @@
"semver": "^7.6.0"
},
"peerDependencies": {
"aws-cdk-lib": "2.147.3",
"aws-cdk": "2.147.3"
"aws-cdk-lib": "2.161.1",
"aws-cdk": "2.161.1"
}
}
2 changes: 1 addition & 1 deletion test/cloudwatch-insights.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Unit test for CloudWatch Addon', () => {
test("Stack is defined when using a specified version of EKS and \"auto\" version", async () => {
const app = new cdk.App();

const addOn = new blueprints.CloudWatchInsights();
const addOn = new blueprints.CloudWatchInsights({});
const version = KubernetesVersion.V1_29;
const blueprint = await blueprints.EksBlueprint.builder()
.version(version)
Expand Down
Loading