A terraform project to setup Elastic Kubernetes Service on AWS
For this project, you will AWS Account, Terraform installed on your local machine, access to a terminal.
-
-
go on AWS website and signup for an account
-
Setup IAM permissions listed on the EKS module documentation
-
Download AWS CLI to configure your machine with your AWS credentials. Folow the instructions here.
-
Install
kubectl
. This will be used to access your clusters after it has been deployed. Follow instructions here
-
Folllow the instructions here to install terraform
-
Clone this github repository
git clone https://github.com/Lordwales/eks-terraform.git
-
cd into the
eks-terraform
directory. -
On your terminal while in the root of the repository, run the following commands in sequence:
terraform init #this will initialize the terrafom project and download the required plugins and create a local backend.
terraform plan #this will display all the resources that are planed to be deployed on AWS.
terraform apply # this will run our terraform code and deploy those resources to AWS.
aws eks update-kubeconfig --region us-east-1 --name terraformEKScluster
Visit the Elastic Kubernetes Service section in your AWS Console to view the details of the newly created cluster.
This project can be further improved dby using S3 as backend
to store the state of the infrastructure especially in a Team scenerio. Also we can use Terraform Cloud
to run the project. This gives more flexibilty, manages our secrets and build, can manage our workspaces too.