-
Confirmed
AWS CDK v0.24.1. -
Problematic security group.
-
Problematic policy.
-
Subnet is restricted to public.
-
Add tags of instance using Userdata.
-
There are a lot of fixed values.
-
Perhaps the EBS volume is as follows.
-
Instance Size Small: 1GB
-
Instance Size Medium: 20GB
-
Instance Size Large: 20GB
-
-
Many more.
-
git clone https://github.com/high-u/cdk-eks.git -
cd cdk-eks -
npm install -prefix ./cluster -
npm install -prefix ./nodegroup
-
cp cdk-default.json cdk.json -
Edit "cdk.json".
-
Input "clusterStackName", "nodeGroupStackName", "clusterName", and "vpcName". (Require)
-
Input "keyPairName" if necessary.
-
Check AMI. https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
-
-
aws configure get region -
cdk -a ./cluster/bin/cluster.js deploy -
cdk -a ./nodegroup/bin/nodegroup.js deploy -
Options not asked for yes / no.
-
--require-approval never
-
-
[[ $(cat cdk.json) =~ (\"clusterName\": \")([^\"]+) ]] && CDK_CLUSTER_NAME=${BASH_REMATCH[2]} -
echo ${CDK_CLUSTER_NAME} -
aws eks update-kubeconfig --name ${CDK_CLUSTER_NAME}
-
curl -O https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2018-12-10/aws-auth-cm.yaml -
[[ $(cat cdk.json) =~ (\"nodeGroupStackName\": \")([^\"]+) ]] && CDK_STACK_NAME=${BASH_REMATCH[2]} -
echo ${CDK_STACK_NAME} -
CDK_NODE_ROLE=$(aws cloudformation describe-stacks --stack-name ${CDK_STACK_NAME} --output text | grep -o arn:aws:iam[a-zA-Z0-9:\/\-]*) -
echo ${CDK_NODE_ROLE} -
sed -ie "s|<ARN of instance role (not instance profile)>|${CDK_NODE_ROLE}|" aws-auth-cm.yaml -
kubectl apply -f aws-auth-cm.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
kubectl apply -f ./yaml/kube-clusterrolebinding.yml
kubectl apply -f ./yaml/kube-service-account.yml
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
kubectl proxy-
npm run buildcompile typescript to js -
npm run watchwatch for changes and compile -
cdk deploydeploy this stack to your default AWS account/region -
cdk diffcompare deployed stack with current state -
cdk synthemits the synthesized CloudFormation template