-
Brief
- An AWS EKS Cluster created with the help module
modules/my_eks_cluster
. - Module creates following resources
- VPC
- 2 Public Subnets for any load balancer deployment & 2 private subnets for node instance deployment
- Internet Gateway for Public Subnet & NAT Gateways for Private Subnets
- 3 Route Tables for Public Subnets & 2 Private Subnets
- IAM Roles for EKS Cluster & Node Groups
- Mutliple policies to mainly let eks control node-group management and permissions
- Node Group for containing the EC2 instances.
- An AWS EKS Cluster created with the help module
-
Prerequisites
- Create an IAM user in AWS, which has access to creates resources(Admin Group). Reference - https://docs.aws.amazon.com/streams/latest/dev/setting-up.html#setting-up-iam or You can also generate the Accese Keys from logged in user in next step.
- Generate Access Keys for the user. Reference - https://docs.aws.amazon.com/powershell/latest/userguide/pstools-appendix-sign-up.html
- Set below environment variables for terraform to authenticate with AWS Provider.
export AWS_ACCESS_KEY_ID="my-access-key" export AWS_SECRET_ACCESS_KEY="my-secret-key" export AWS_REGION="your-region"
- Install Terraform - https://developer.hashicorp.com/terraform/downloads
-
Usage
- Navigate to
./p41-infra/eks/
- Open main.tf and provide cluster specific information in module section to these variables -
vpc_cidr_block
cluster_name
az
subnet_cidr_blocks
node_instance_type
node_instance_size
- Navigate to
-
Apply
- Get the blueprint of the resource deployment using -
terraform plan
. - If everything looks fine then
terraform apply
. - To get kubeconfig locally (in the current context)
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
- You can access the cluster with
kubectl
commands now.
- Get the blueprint of the resource deployment using -
- Brief
- Deployment of the manifest at
./app/microservice.yml
using terraform.
- Deployment of the manifest at
- Prerequisites
- Create the eks cluster using above steps & generate the
.tfstate
files.
- Create the eks cluster using above steps & generate the
- Usage
- Navigate to
./p41-infra/k8s_deploy/
- Navigate to
- Apply
- To get blueprint of the deployment -
terraform plan
- To apply the resources -
terraform apply
- To get blueprint of the deployment -
- Brief
- Nginx deployment using helm chart.
- Prerequisites
- Create the eks cluster using above steps & generate the
.tfstate
files.
- Create the eks cluster using above steps & generate the
- Usage
- Navigate to
./p41-infra/helm_deploy/
- Navigate to
- Apply
- To get blueprint of the deployment -
terraform plan
- To apply the resources -
terraform apply
- To get blueprint of the deployment -