To accomplish this task, you have to install these tools
- eksctl - https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html
- awscli - https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
There are 2 files:
aurora.yml
- cloudformation templateaurora-values.json
- variables value file
aws cloudformation create-stack --stack-name aurora-cluster-test --template-body file://aurora.yml --parameters file://aurora-values.json
s3.yml
- cloudformation templates3-values.json
- variables value file
aws cloudformation create-stack --stack-name s3-test --template-body file://s3.yml --parameters file://s3-values.json
efs.yml
- cloudformation templateefs-values.json
- variables value file Noteefs-values.json
require 3 different subnet in different zone A, B,C. And Security Group from aurora stack output.
aws cloudformation create-stack --stack-name efs-test --template-body file://efs.yml --parameters file://efs-values.json
Before setting up eks cluster. you have to create a new security group (<CLUSTER_SECURITY_GROUP> for later use) that allow inbound port 443
from 0.0.0.0/0
eks-cluster.yml
break out
metadata:
name: <CLUSTER_NAME>
region: <AWS_REGION>
version: "<EKS_VERSION>"
vpc:
id: <VPC_ID>
cidr: <VPC_CIDR>
securityGroup: "<CLUSTER_SECURITY_GROUP>"
cidr: "10.1.0.0/16"
autoAllocateIPv6: false
clusterEndpoints:
publicAccess: false
privateAccess: true
subnets:
private:
us-west-2a:
id: <PRIVATE_SUBNET_IN_ZONE_A>
us-west-2b:
id: <PRIVATE_SUBNET_IN_ZONE_B>
us-wesst-2c:
id: <PRIVATE_SUBNET_IN_ZONE_C>
nodeGroups:
- name: <WORKER_GROUP_NAME>
instanceType: <WORKER_INSTANCE_TYPE>
securityGroups:
withShared: true
attachIDs:
- <SECURITY_GROUP_FROM_AURORA_OUTPUT>
desiredCapacity: 4
...
# Eks setup could take 15-20 mins or longer
eksctl create cluster -f eks-cluster.yml
Clean up the cluster
eksctl delete cluster -f eks-cluster.yml