Skip to content

Commit

Permalink
porting to the latest eks-blueprints and doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shapirov103 committed Mar 24, 2022
1 parent 6c0af20 commit 1bf8554
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ssp-eks-extension
Supplemental repository that shows how to create extensions for https://github.com/aws-quickstart/ssp-amazon-eks.
# eks-blueprints-extension
Supplemental repository that shows how to create extensions for https://github.com/aws-quickstart/cdk-eks-blueprints.
Demonstrates how to create an independent add-on for SSP, create a Kubernetes namespace and service account integrated with IAM roles (IRSA) to access AWS resources, configure secrets in AWS Secrets Manager and leverage them in your add-on (for example a license).

# Prerequisites
Expand All @@ -15,15 +15,16 @@ $ sudo brew install make
$ sudo brew install node
```

Make sure that the installed Node.js version is compatible with CDK. More information can be found [here](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#:~:text=All%20AWS%20CDK,a%20different%20recommendation.) (scroll to the "Prerequisites" section).
Make sure that the installed Node.js version is compatible with CDK (16.x). More information can be found [here](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#:~:text=All%20AWS%20CDK,a%20different%20recommendation.) (scroll to the "Prerequisites" section).

3. Install [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and provide credentials by running `aws configure`.

4. In order to avoid problems with CDK version potentially being different from the version used by the AWS SSP for EKS create a local alias for CDK (as opposed to system wide installation). For that include the following alias to your ~/.bashrc or ~/.zshrc file:
4. In order to avoid problems with CDK version potentially being different from the version used by the AWS EKS Blueprints create a local alias for CDK (as opposed to system wide installation). For that include the following alias to your ~/.bashrc or ~/.zshrc file:

```
alias cdk="npx cdk"
```

Make sure you run `source ~/.bashrc` after editing the file.

Example for mac/linux terminal:
Expand All @@ -35,21 +36,21 @@ $ source ~/.zshrc

5. Clone this git repository
```
git clone https://github.com/shapirov103/ssp-eks-extension.git
cd ssp-eks-extension
git clone https://github.com/shapirov103/eks-blueprints-extension.git
cd eks-blueprints-extension
```

6. Modify package.json and provide your name for the package including your organization. Example:
```
"name": "@mycompany/ssp-addon-myproduct"
"name": "@mycompany/myproduct-eks-blueprints-addon"
```
Where 'myproduct' should be replaced with the name of your product.

7. Apply other dependencies to the package.json and make sure that the CDK version used in the file is the one that is used by the SSP EKS Quickstart, which can be looked up on the [Getting Started Page](https://github.com/aws-quickstart/ssp-amazon-eks#getting-started) or directly in the [package.json](https://github.com/aws-quickstart/ssp-amazon-eks/blob/main/package.json).
7. Apply other dependencies to the package.json and make sure that the CDK version used in the file is the one that is used by the EKS Blueprints Quickstart, which can be looked up on the [Getting Started Page](https://github.com/aws-quickstartcdk-eks-blueprints#getting-started) or directly in the [package.json](https://github.com/aws-quickstart/cdk-eks-blueprints/blob/main/package.json).

8. Run `npm i`.

9. Apply changes to `lib/index.ts` to implement your add-on. Note. the quickstart provides convenience base class `HelmAddOn` for add-ons that leverage a helm chart. It has a few advantages, including ability to use GitOps for add-on management.
9. Apply changes to `lib/index.ts` to implement your add-on. Note: EKS Blueprints framework provides convenience base class `HelmAddOn` for add-ons that leverage a helm chart. It has a few advantages, including ability to use GitOps for add-on management.

10. Apply changes to `bin/main.ts` to test your add-on.

Expand All @@ -58,4 +59,5 @@ Where 'myproduct' should be replaced with the name of your product.
13. Use Jest test framework for any unit tests.
14. Run `npm publish` to publish your add-on to npm.
15. Create documentation, populate README on the repo.
16. Create an example pattern and documentation that could be submitted to https://github.com/aws-samples/ssp-eks-patterns
16. Create an example pattern and documentation that could be submitted to https://github.com/aws-samples/cdk-eks-blueprints-patterns.

6 changes: 3 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as blueprints from '@aws-quickstart/eks-blueprints';
import { ServiceAccount } from 'aws-cdk-lib/aws-eks';
import { ManagedPolicy } from 'aws-cdk-lib/aws-iam';
import { Construct } from 'constructs';
import { ServiceAccount } from 'aws-cdk-lib/aws-eks';
import * as blueprints from '@aws-quickstart/eks-blueprints';


export interface MyFluentBitAddOnProps extends blueprints.addons.HelmAddOnUserProps {
Expand All @@ -22,7 +22,7 @@ export const defaultProps: blueprints.addons.HelmAddOnProps & MyFluentBitAddOnPr
cloudWatchRegion: 'us-east-1',
name: 'my-addon',
namespace: 'kube-system',
release: 'ssp-addon-myextension-fluent-bit',
release: 'blueprints-addon-myextension-fluent-bit',
version: '0.1.11',
repository: 'https://aws.github.io/eks-charts',
values: {}
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "ssp-eks-extension-sample",
"name": "eks-blueprints-extension-sample",
"version": "0.1.0",
"main": "dist/lib/index.js",
"types": "dist/lib/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"eks-ssp-patterns": "dist/bin/main.js"
"eks-blueprints-patterns": "dist/bin/main.js"
},
"scripts": {
"build": "rm -rf dist && tsc",
Expand All @@ -27,7 +27,7 @@
},
"peerDependencies": {
"source-map-support": "^0.5.16",
"@aws-quickstart/eks-blueprints": "file:../quickstart-ssp-amazon-eks/aws-quickstart-eks-blueprints-0.1.0.tgz",
"@aws-quickstart/eks-blueprints": "latest",
"aws-cdk": "2.17.0"
}
}

0 comments on commit 1bf8554

Please sign in to comment.