https://github.com/tankibaj/terraform-eks
Deploy an EKS cluster using Terraform
https://github.com/tankibaj/terraform-eks
aws eks kubernetes terraform
Last synced: 2 months ago
JSON representation
Deploy an EKS cluster using Terraform
- Host: GitHub
- URL: https://github.com/tankibaj/terraform-eks
- Owner: tankibaj
- Created: 2021-04-24T14:23:19.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-01T14:30:12.000Z (over 4 years ago)
- Last Synced: 2025-02-17T21:36:49.037Z (8 months ago)
- Topics: aws, eks, kubernetes, terraform
- Language: HCL
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Provision an EKS Cluster using Terraform
The Amazon Elastic Kubernetes Service (EKS) is the AWS service for deploying, managing, and scaling containerized applications with Kubernetes.
Deploy an EKS cluster using Terraform and configure `kubectl` using Terraform output.
## Prerequisites
- [AWS account](https://portal.aws.amazon.com/billing/signup?nc2=h_ct&src=default&redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation#/start) with the IAM permissions listed on the [EKS module documentation](https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/iam-permissions.md).
- [AWS CLI](https://aws.amazon.com/cli/)
```bash
brew install awscli
```- [AWS IAM Authenticator](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html)
```bash
brew install aws-iam-authenticator
```- [Kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/)
```
brew install kubernetes-cli
```- [Terraform](https://www.terraform.io/downloads.html)
```bash
brew install terraform
```
## Quick Start
#### Terraform
- Prepare your working directory for other commands
```bash
terraform init
```- Show changes required by the current configuration
```bash
terraform plan
```- Create infrastructure
```bash
terraform apply
```
#### Configure kubectl
Now that you've provisioned your EKS cluster, you need to configure kubectl. Run the following command to retrieve the access credentials for your cluster and automatically configure kubectl.
```bash
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
```#### Test EKS cluster
```bash
kubectl get all
```#### Clean up your workspace
```bash
terraform destroy
```