Overview: This repo is for setting up AWS EKS demo cluster using Terraform AWS EKS Wrapper module. For more information on Terraform AWS EKS Wrapper module please refer here
kubectl
terraform
helm
4. Terraform AWS EKS Module will attach Worker nodes to EKS Cluster automatically. So we don't need to use helm.
1. Make sure to update terraform/config.auto.tfvars
values as per your environment, Below are few important items to be updated.
Update the aws-auth configs in terraform/config.auto.tfvars
aws_accounts = ["<aws-account-no>"]
aws_roles = [{
rolearn = "arn:aws:iam::<aws-account-no>:role/<aws-iam-role>"
username = "system:node:{{EC2PrivateDNSName}}"
groups = ["system:masters"]
},]
aws_users = [{
userarn = "arn:aws:iam::<aws-account-no>:user/<iam-user-1>"
username = "<iam-user-1>"
groups = ["system:masters"]
},
{
userarn = "arn:aws:iam::<aws-account-no>:user/<iam-user-2>"
username = "<iam-user-2>"
groups = ["system:masters"]
},]
terraform {
backend "s3" {
region = "<aws-region>"
bucket = "<aws-s3-bucket-name>"
key = "terraform/<environment>/terraform.tfstate"
encrypt = true #AES-256 encryption
}
}
aws eks update-kubeconfig --name <eks-cluster-name> --kubeconfig ~/.kube/config --region <aws-region>
kubectl get namespaces
kubectl get nodes