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

Task/1.16.3 release prep #1106

Merged
merged 15 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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.162.1"
"version": "2.173.4"
}
},
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
Expand Down
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.162.1
npm install -g aws-cdk@2.173.4
```

Verify the installation.

```bash
cdk --version
# must output 2.162.1
# must output 2.173.4
```

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.162.1
npm install -g aws-cdk@2.173.4
```

Verify the installation.

```bash
cdk --version
# must output 2.162.1
# must output 2.173.4
```

Create a new CDK project. We use `typescript` for this example.
Expand Down
6 changes: 3 additions & 3 deletions docs/addons/gmaestro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gMaestro add-on for Amazon EKS Blueprints

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.
This add-on deploys the [gMaestro Agent](https://app.granulate.io/) 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.

Expand All @@ -9,8 +9,8 @@ This add-on will deploy gMaestro agent on a namespace of your choice and create

## Prerequisites
Before using gMaestro, you need to:
1. [Sign up](https://app.granulate.io/gMaestroSignup) to the gMaestro platform
2. Download a config YAML file - After signing up to gMaestro, navigate to the [Deploy](https://app.granulate.io/deploy) on the left-hand menu, fill in the required fields and click on "Generate Config File" as shown bellow:
1. [Sign up](https://app.granulate.io/) to the gMaestro platform
2. Download a config YAML file - After signing up to gMaestro, navigate to the [Deploy](https://app.granulate.io/) on the left-hand menu, fill in the required fields and click on "Generate Config File" as shown bellow:

![GmaestroGenerateConfigFile](./../assets/images/gmaestro-generate-config-file.png)

Expand Down
72 changes: 71 additions & 1 deletion docs/addons/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,76 @@ The `eks-blueprints` framework leverages a modular approach to managing [Add-ons

Within the context of the `eks-blueprints` framework, an add-on is abstracted as `ClusterAddOn` interface, and the implementation of the add-on interface can do whatever is necessary to support the desired add-on functionality. This can include applying manifests to a Kubernetes cluster or calling AWS APIs to provision new resources.

Here's an improved version of the public documentation abstract with enhanced readability:

## Add-on Dependencies and Ordering in EKS Blueprints

Add-ons in EKS Blueprints rely on CDK/CloudFormation constructs for provisioning. By default, these constructs don't guarantee a specific order unless explicitly defined using the [CDK dependency mechanism](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib-readme.html#dependencies).

**Default Behavior**
- Add-ons without explicit dependencies are provisioned concurrently in an arbitrary order.
- The order in which you add add-ons to the blueprint may not matter if there are no explicit dependencies between them.

Lack of explicit dependencies can lead to:
- Race conditions
- Non-deterministic behavior
- Difficult-to-troubleshoot problems

For example, if an add-on requires the AWS LoadBalancer Controller to be in place, but there's no explicit dependency, the dependent add-on might start installing before the ALB controller is fully provisioned.

### Built-in Dependencies

Many add-ons in EKS Blueprints have pre-defined dependencies. For example, `Istio*` add-ons depend on `IstioBase`, `AmpAddOn` depends on `AdotCollectorAddOn`, etc.

These dependencies are implemented using the `@dependable` decorator applied to the `deploy` method of the dependent add-on:

```typescript
export class AmpAddOn implements ClusterAddOn {
@dependable(AdotCollectorAddOn.name)
deploy(clusterInfo: ClusterInfo): Promise<Construct> {
// Implementation
}
}
```

### Custom Ordering

For cases where the framework doesn't capture all necessary dependencies, you have two options:

1. Subclass an add-on and override the `deploy` method to declare additional dependencies.
2. Use the EKS Blueprints framework's mechanism to create dependencies at the project level.

**Creating Dependencies at the Project Level**

To ensure one add-on is installed before another:

1. Ensure the prerequisite add-on is added to the blueprint ahead of the dependent add-ons.
2. Mark the prerequisite add-on as "strictly ordered" using:

```typescript
Reflect.defineMetadata("ordered", true, blueprints.addons.PrerequisiteAddOn);
```

This ensures that all add-ons declared after the marked add-on will only be provisioned after it's successfully deployed.

### Example

```typescript
// Enable detailed logging
blueprints.utils.logger.settings.minLevel = 1;

// Mark AwsLoadBalancerControllerAddOn as requiring strict ordering
Reflect.defineMetadata("ordered", true, blueprints.addons.AwsLoadBalancerControllerAddOn);

blueprints.EksBlueprint.builder()
.addOns(new VpcCniAddon) // add all add-ons that do NOT need to depend on ALB before the ALB add-on
.addOns(new AwsLoadBalancerControllerAddOn())
.addOns(new MyAddOn()) // Automatically depends on AwsLoadBalancerControllerAddOn
.build(...);
```

Note: You can mark multiple add-ons as `ordered` if needed.

## Supported Add-ons

The framework currently supports the following add-ons.
Expand Down Expand Up @@ -79,7 +149,7 @@ The framework currently supports the following add-ons.
| [`VeleroAddOn`](./velero.md) | Adds [Velero](https://velero.io/) to the EKS Cluster. | ✅ | ✅ |
| [`XrayAddOn`](./xray.md) | Adds XRay Daemon to the EKS Cluster. | NA | NA
| [`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. |
| ~~[`GmaestroAddOn`](./gmaestro.md)~~ | Deprecated due to EOL. Adds [gMaestro](https://app.granulate.io) 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) | ✅ | ✅ |


Expand Down
2 changes: 1 addition & 1 deletion docs/addons/paralus.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ blueprints.EksBlueprint.builder()
| `deploy.postgresql.enable` | Deploy and use postgres database | false |
| `deploy.postgresql.dsn` | DSN of your existing postgres database for paralus to use | "" |
| `deploy.fluentbit.enable` | Deploy and use fluentbit for auditlogs with database storage | "" |
| `paralus.initialize.adminEmail` | Admin email to access paralus | "<[email protected]>" |
| `paralus.initialize.adminEmail` | Admin email to access paralus | `[email protected]` |
| `paralus.initialize.org` | Organization name using paralus | "ParalusOrg" |
| `auditLogs.storage` | Default storage of auditlogs | "database" |
| `fqdn.domain` | Root domain | "paralus.local" |
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.162.1 # may require sudo (Ubuntu) depending on configuration
cdk --version # must produce 2.162.1
npm install -g aws-cdk@2.173.4 # may require sudo (Ubuntu) depending on configuration
cdk --version # must produce 2.173.4
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.162.1`.
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.173.4`.

**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.162.1
npm install -g aws-cdk@2.173.4
```

Install the dependencies for this project.
Expand Down
Loading
Loading