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).
Instructions are provided for MacOS. For Linux and Windows please consult documentation how to install the required components (make
, nodejs
). Please consider contributing to this guide.
- Install Make on Mac.
$ sudo brew install make
- Install Node.js.
$ sudo brew install node
Make sure that the installed Node.js version is compatible with CDK (16.x). More information can be found here (scroll to the "Prerequisites" section).
-
Install AWS CLI and provide credentials by running
aws configure
. -
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:
$ echo 'alias cdk="npx cdk"' >> ~/.zshrc
$ source ~/.zshrc
- Clone this git repository
git clone https://github.com/shapirov103/eks-blueprints-extension.git
cd eks-blueprints-extension
- Modify package.json and provide your name for the package including your organization. Example:
"name": "@mycompany/myproduct-eks-blueprints-addon"
Where 'myproduct' should be replaced with the name of your product.
-
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 or directly in the package.json.
-
Run
npm i
. -
Apply changes to
lib/index.ts
to implement your add-on. Note: EKS Blueprints framework provides convenience base classHelmAddOn
for add-ons that leverage a helm chart. It has a few advantages, including ability to use GitOps for add-on management. -
Apply changes to
bin/main.ts
to test your add-on. -
Run
make build
,make lint
,cdk list
to build. -
Run
cdk deploy
to test the blueprint with deployment to AWS. -
Use Jest test framework for any unit tests.
-
Run
npm publish
to publish your add-on to npm. -
Create documentation, populate README on the repo.
-
Create an example pattern and documentation that could be submitted to https://github.com/aws-samples/cdk-eks-blueprints-patterns.