Skip to content

Commit dbde9cd

Browse files
authored
Merge pull request #8 from doitintl/qa_after_branch_rename
finished Qa after branch rename
2 parents b137cfc + 9431351 commit dbde9cd

File tree

14 files changed

+554
-3205
lines changed

14 files changed

+554
-3205
lines changed

.flox/env/manifest.lock

Lines changed: 210 additions & 217 deletions
Large diffs are not rendered by default.

.flox/env/manifest.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
version = 1 # Visit flox.dev/docs/concepts/manifest/
22

33
[install] # (List of packages installed in environment)
4-
aws = { pkg-path = "awscli2", version = "2.17.42" }
5-
aws_cdk_dependency_ts = { pkg-path = "typescript", version = "5.6.2" }
6-
aws_cdk_dependency_nodejs = { pkg-path = "nodejs", version = "20.17.0" } #(v20 = LTS, long term support)
7-
cdk = { pkg-path = "nodePackages.aws-cdk", version = "2.159.1", pkg-group = "aws-cdk" }
4+
aws = { pkg-path = "awscli2", version = "2.26.4" }
5+
aws_cdk_dependency_ts = { pkg-path = "typescript", version = "5.8.2" }
6+
aws_cdk_dependency_nodejs = { pkg-path = "nodejs", version = "22.14.0" } #(v22 = LTS, long term support)
7+
cdk = { pkg-path = "nodePackages.aws-cdk", version = "2.1004.0", pkg-group = "aws-cdk" }
88
jq = { pkg-path = "jq", version = "1.7.1" }
99
# Note: pkg-group isolates dependencies to prevent conflict
1010
# Note: a cdk specific NixOS pgk bug exists https://github.com/NixOS/nixpkgs/issues/236151
1111
# cdk init app --language typescript
1212
# ^-- fails, workaround--v
13-
# npx aws-cdk@2.133.0 init app --language typescript
13+
# npx aws-cdk@2.1004.0 init app --language typescript
1414

1515
# If there's ever a need to update pinned versions of above dependencies in the future
1616
# cd to the root of this git repo (where /.flox/ exists)
1717
# Then run the following commands to see available versions
1818
# flox show awscli2
19-
# flox show nodejs
2019
# flox show typescript
20+
# flox show nodejs
2121
# flox show nodePackages.aws-cdk
2222
# flox show jq
2323
##################################################################################
24-
# ^-- While you're at it try to update the node.js packages
25-
# npm install [email protected]
26-
# npm audit fix
27-
##################################################################################
2824

2925

3026

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ENV AWS_PAGER=""
2525
WORKDIR /app
2626
# ^-- configure default working directory
2727

28-
COPY cdk.json package.json package-lock.json tsconfig.json /app
28+
COPY cdk.json cdk.context.json package.json package-lock.json tsconfig.json /app
2929
RUN npm install
3030
ENV PATH="/app/node_modules/.bin:$PATH"
3131
# ^-- package.json & package-lock.json tell npm install what dependencies to install

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## What is Easy EKS?
44
An opinionated bundling of automation & Infrastructure as code that aims to:
5-
1. Make it easy to provision EKS clusters that are production ready by default.
6-
2. Maintain a heavily standardized opinionated set of IaC, which makes automation easier.
7-
3. Apply a helm like design pattern to AWS CDK.
5+
1. Make it easy to provision EKS clusters that are nearly production ready by default.
6+
2. Maintain a heavily standardized opinionated set of IaC, which makes automation maintainable.
7+
3. Apply useful design patterns from Helm and Kustomize to IaC based on AWS CDK.
88

99
## What is the current status of Easy EKS?
1010
Pre-Alpha

cdk.context.json

Lines changed: 3 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,10 @@
55
"ca-central-1d"
66
],
77
"ami:account=905418347382:filters.image-type.0=machine:filters.name.0=fck-nat-al2023-*-arm64-ebs:filters.state.0=available:owners.0=568608671756:region=ca-central-1": "ami-045d3a84706b8feeb",
8-
"vpc-provider:account=905418347382:filter.isDefault=false:filter.tag:Name=lower-envs-vpc:region=ca-central-1:returnAsymmetricSubnets=true": {
9-
"vpcId": "vpc-0f79593fc83da0b82",
10-
"vpcCidrBlock": "10.99.0.0/16",
11-
"ownerAccountId": "905418347382",
12-
"availabilityZones": [],
13-
"subnetGroups": [
14-
{
15-
"name": "Private",
16-
"type": "Private",
17-
"subnets": [
18-
{
19-
"subnetId": "subnet-05cc9568f5db856f2",
20-
"cidr": "10.99.32.0/19",
21-
"availabilityZone": "ca-central-1a",
22-
"routeTableId": "rtb-02272b1ca2d8ad552"
23-
},
24-
{
25-
"subnetId": "subnet-0cc493d68888b47ca",
26-
"cidr": "10.99.64.0/19",
27-
"availabilityZone": "ca-central-1b",
28-
"routeTableId": "rtb-0cdc4e773fe8cfc21"
29-
},
30-
{
31-
"subnetId": "subnet-00e3b357b26ccd5d0",
32-
"cidr": "10.99.96.0/19",
33-
"availabilityZone": "ca-central-1d",
34-
"routeTableId": "rtb-08efc0ea91ffab31d"
35-
}
36-
]
37-
},
38-
{
39-
"name": "Public",
40-
"type": "Public",
41-
"subnets": [
42-
{
43-
"subnetId": "subnet-071ff1ffe0c3dd854",
44-
"cidr": "10.99.0.0/23",
45-
"availabilityZone": "ca-central-1a",
46-
"routeTableId": "rtb-0981fc558ab2004b2"
47-
},
48-
{
49-
"subnetId": "subnet-0ade167af81ba5fc2",
50-
"cidr": "10.99.2.0/23",
51-
"availabilityZone": "ca-central-1b",
52-
"routeTableId": "rtb-069a562753013d2c2"
53-
},
54-
{
55-
"subnetId": "subnet-060c40cdf18bc529e",
56-
"cidr": "10.99.4.0/23",
57-
"availabilityZone": "ca-central-1d",
58-
"routeTableId": "rtb-05f3c194a62bd6451"
59-
}
60-
]
61-
}
62-
]
63-
},
648
"key-provider:account=905418347382:aliasName=alias/eks/lower-envs:region=ca-central-1": {
659
"keyId": "2c710e12-cad3-42f5-a92f-e7d7980aebea"
6610
},
67-
"vpc-provider:account=905418347382:filter.isDefault=false:filter.tag:Name=lower-envs-vpc:filter.vpc-id=vpc-0f79593fc83da0b82:region=ca-central-1:returnAsymmetricSubnets=true": {
68-
"vpcId": "vpc-0f79593fc83da0b82",
69-
"vpcCidrBlock": "10.99.0.0/16",
70-
"ownerAccountId": "905418347382",
71-
"availabilityZones": [],
72-
"subnetGroups": [
73-
{
74-
"name": "Private",
75-
"type": "Private",
76-
"subnets": [
77-
{
78-
"subnetId": "subnet-05cc9568f5db856f2",
79-
"cidr": "10.99.32.0/19",
80-
"availabilityZone": "ca-central-1a",
81-
"routeTableId": "rtb-010c7b9bdb7d1d475"
82-
},
83-
{
84-
"subnetId": "subnet-0cc493d68888b47ca",
85-
"cidr": "10.99.64.0/19",
86-
"availabilityZone": "ca-central-1b",
87-
"routeTableId": "rtb-010c7b9bdb7d1d475"
88-
},
89-
{
90-
"subnetId": "subnet-00e3b357b26ccd5d0",
91-
"cidr": "10.99.96.0/19",
92-
"availabilityZone": "ca-central-1d",
93-
"routeTableId": "rtb-010c7b9bdb7d1d475"
94-
}
95-
]
96-
}
97-
]
98-
}
11+
"acknowledged-issue-numbers": [
12+
32775
13+
]
9914
}

config/eks/higher_envs_eks_config.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ export function apply_config(config: Easy_EKS_Config_Data, stack: cdk.Stack){ //
1414
//config.setVpcById("vpc-0dbcacb511f9bac4e", config, stack); //Alternative pre-existing VPC deployment option
1515
config.setBaselineMNGSize(2);
1616
config.setBaselineMNGType(eks.CapacityType.ON_DEMAND);
17-
//config.addClusterAdminARN(`arn:aws:iam::${process.env.CDK_DEFAULT_ACCOUNT!}:user/example`);
18-
//^--Important Note: identity referenced in ARN must exist or the deployment will fail
19-
// This allows you to create a explicit list of ARNS (representing IAM roles or users)
20-
// That act as EKS Admins of all higher environments.
17+
if(process.env.CDK_DEFAULT_ACCOUNT==="111122223333"){
18+
config.addClusterAdminARN(`arn:aws:iam::111122223333:user/example`);
19+
/* Note:
20+
config.addClusterAdminARN('...:user/example') should only be used in an if statement,
21+
Because the identity referenced in ARN must exist or the deployment will fail
22+
This allows you to create a explicit list of ARNs (representing IAM roles or users)
23+
That act as EKS Admins of all higher environments.
24+
*/
25+
}
2126
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2227

2328

@@ -27,7 +32,7 @@ export function apply_config(config: Easy_EKS_Config_Data, stack: cdk.Stack){ //
2732
config.setKubectlLayer(new KubectlV31Layer(stack, 'kubectl'));
2833
config.addEKSAddon('kube-proxy', { //spelling matters for all addons
2934
addonName: 'kube-proxy', //spelling matter & should match above
30-
addonVersion: 'v1.31.3-eksbuild.2', //Commented out for default (it won't be latest)
35+
addonVersion: 'v1.31.7-eksbuild.7', //Note you can comment this out, but you'll get default instead of latest.
3136
// Use this to look up latest
3237
// aws eks describe-addon-versions --kubernetes-version=1.31 --addon-name=kube-proxy --query='addons[].addonVersions[].addonVersion' | jq '.[0]'
3338
resolveConflicts: 'OVERWRITE',

config/eks/lower_envs_eks_config.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ export function apply_config(config: Easy_EKS_Config_Data, stack: cdk.Stack){ //
1414
//config.setVpcById("vpc-0dbcacb511f9bac4e", config, stack); //Alternative pre-existing VPC deployment option
1515
config.setBaselineMNGSize(2);
1616
config.setBaselineMNGType(eks.CapacityType.SPOT);
17-
//config.addClusterAdminARN(`arn:aws:iam::${process.env.CDK_DEFAULT_ACCOUNT!}:user/example`);
18-
//^--Important Note: identity referenced in ARN must exist or the deployment will fail
19-
// This allows you to create a explicit list of ARNS (representing IAM roles or users)
20-
// That act as EKS Admins of all lower environments.
17+
if(process.env.CDK_DEFAULT_ACCOUNT==="111122223333"){
18+
config.addClusterAdminARN(`arn:aws:iam::111122223333:user/example`);
19+
/* Note:
20+
config.addClusterAdminARN('...:user/example') should only be used in an if statement,
21+
Because the identity referenced in ARN must exist or the deployment will fail
22+
This allows you to create a explicit list of ARNs (representing IAM roles or users)
23+
That act as EKS Admins of all lower environments.
24+
*/
25+
}
2126
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2227

2328

@@ -27,7 +32,7 @@ export function apply_config(config: Easy_EKS_Config_Data, stack: cdk.Stack){ //
2732
config.setKubectlLayer(new KubectlV31Layer(stack, 'kubectl'));
2833
config.addEKSAddon('kube-proxy', { //spelling matters for all addons
2934
addonName: 'kube-proxy', //spelling matter & should match above
30-
addonVersion: 'v1.31.3-eksbuild.2', //Commented out for default (it won't be latest)
35+
addonVersion: 'v1.31.7-eksbuild.7', //Note you can comment this out, but you'll get default instead of latest.
3136
// Use this to look up latest
3237
// aws eks describe-addon-versions --kubernetes-version=1.31 --addon-name=kube-proxy --query='addons[].addonVersions[].addonVersion' | jq '.[0]'
3338
resolveConflicts: 'OVERWRITE',

docs/04_Prerequisites/Recommended_Long-Term_Setup.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,14 @@
7070
cat /etc/os-release
7171
uname -r
7272
# ^-- The above commands say we're on an rpm based x86_64 distro of Amazon Linux 2023
73-
wget https://downloads.flox.dev/by-env/stable/rpm/flox-1.3.2.x86_64-linux.rpm
73+
wget https://downloads.flox.dev/by-env/stable/rpm/flox-1.4.1.x86_64-linux.rpm
7474
sudo rpm --import https://downloads.flox.dev/by-env/stable/rpm/flox-archive-keyring.asc
7575
sudo rpm -ivh ~/flox-*.rpm
7676
flox --version
7777
rm ~/flox-*.rpm
78-
# 1.3.2
78+
# 1.4.1
7979
```
8080

81-
4. Install node.js modules
82-
```shell
83-
# flox [flox.dev]
84-
# [admin@workstation:~/easyeks]
85-
npm install
86-
# ^-- will populate a /node_modules/, based on package.json
87-
```
8881

8982
--------------------------------------------------------------------------------------------------------------
9083

@@ -107,7 +100,7 @@ npm install
107100
## Phase 3: Git Repo Setup
108101

109102
### Phase 3A: Git Repo Setup (Generic Overview)
110-
2. Gain the ability to clone a private git repo (here's an example based on private github)
103+
1. Gain the ability to clone a private git repo (here's an example based on private github)
111104
1. create a classic readonly GitHub Token to clone private doit repo
112105
* https://github.com/settings/tokens/new
113106
* note = test <-- note this value represents TOKEN_NAME
@@ -119,7 +112,7 @@ npm install
119112
`ghp_jwiZWtzLWNkay1xdWlja3N0YXJ0CgwMjQtMD`
120113
121114
### Phase 3B: Git Repo Setup (Detailed Instructions for Private GitHub Repo)
122-
3. Copy Paste Commands (one line at a time) to clone private github repo from AWS Cloud Shell
115+
1. Copy Paste Commands (one line at a time) to clone private github repo from AWS Cloud Shell
123116
```shell
124117
# [ec2-user@ec2-bastion-with-iam-admin-role:~]
125118
sudo dnf update -y
@@ -130,19 +123,22 @@ export TOKEN_PASS="ghp_jwiZWtzLWNkay1xdWlja3N0YXJ0CgwMjQtMD"
130123
cd ~
131124
git clone https://$TOKEN_NAME:[email protected]/doitintl/easyeks.git
132125
cd ~/easyeks
126+
cdk context --clear
127+
# ^-- resets cdk.context.json to {}
128+
# (Technically not necessary, done for the sake of housekeeping / keeping things tidy.)
133129
```
134130
135131
--------------------------------------------------------------------------------------------------------------
136132
137133
## Phase 4: CDK Bootstrap
138-
5. Change current working directory to the repo, which has a .flox folder
134+
1. Change current working directory to the repo, which has a .flox folder
139135
```shell
140-
#[ec2-user@ec2-bastion-with-iam-admin-role:~]#
141-
ls -lah ~/easyeks | grep .flox
136+
#[ec2-user@ec2-bastion-with-iam-admin-role:~/easyeks]#
142137
cd ~/easyeks
138+
ls -lah | grep .flox
143139
```
144140
145-
6. Run flox activate in that folder
141+
1. Run flox activate in that folder
146142
```shell
147143
#[ec2-user@ec2-bastion-with-iam-admin-role:~/easyeks]#
148144
flox activate
@@ -156,13 +152,15 @@ cdk --version
156152
npm --version
157153
```
158154
159-
* Bootstrap cdk
155+
1. Install node.js modules
160156
```shell
161-
export AWS_REGION=ca-central-1
162-
cdk bootstrap
157+
# flox [flox.dev]
158+
# [admin@workstation:~/easyeks]
159+
npm install
160+
# ^-- will populate a /node_modules/, based on package.json
163161
```
164162
165-
7. CDK Bootstrap and Deploy
163+
1. Bootstrap CDK
166164
```shell
167165
#[ec2-user@ec2-bastion-with-iam-admin-role:~/easyeks]#
168166
aws sts get-caller-identity
@@ -171,8 +169,16 @@ export AWS_REGION="ca-central-1"
171169
# ^-- recommend add a region to ~/.bashrc, or `aws configure`
172170
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity | jq .Account | tr -d '\"')
173171
echo $AWS_ACCOUNT_ID
174-
cdk bootstrap aws://$AWS_ACCOUNT_ID/ca-central-1
172+
time cdk bootstrap aws://$AWS_ACCOUNT_ID/$AWS_REGION
175173
# ^-- bootstraps the region, after which you'll see a Stack name of "CDKToolkit"
176174
# in AWS Web GUI Console > CloudFormation > Stacks (for that region)
177175
# Note you can only deploy into region's that have been bootstrapped
178176
```
177+
178+
1. Deploy cdk stacks
179+
```shell
180+
#[ec2-user@ec2-bastion-with-iam-admin-role:~/easyeks]#
181+
time cdk list
182+
time cdk deploy lower-envs-vpc
183+
time cdk deploy dev1-eks
184+
```

docs/09_Project_Goals_and_Target_Audience/Project_Goals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Easy EKS's Project Goals
2-
Easy EKS = EKS + Apps + Config + Infrastructure as Code + Automation + Docs.
2+
Easy EKS = EKS + Kube Apps + Config + Infrastructure as Code + Automation + Docs.
33

44
## 1. Make a standardized baseline distribution of EKS
55
* Standardization is a prerequisite for:

0 commit comments

Comments
 (0)