Skip to content

A minimal Terraform configuration designed to quickly deploy and test applications and infrastructure configurations on Amazon EKS (Elastic Kubernetes Service). Ideal for development, experimentation, and validation of Kubernetes-based workloads.

Notifications You must be signed in to change notification settings

csepulveda/minimal-eks

Repository files navigation

minimal-eks

Instructions to init the environment

  1. Initialize the Project Run the following command to initialize the project:
tofu init
  1. Plan the Changes Generate an execution plan to preview the changes
tofu plan
  1. Create the EKS cluster and Karpenter Only If the plan looks correct, apply the changes to deploy the resources: (take aproximatly 10 to 15 minutes.)
tofu apply -target="module.vpc" -target="module.eks" -target="module.karpenter" -target="helm_release.karpenter" -target="kubectl_manifest.karpenter_node_class" -target="kubectl_manifest.karpenter_node_pool"
  1. Apply all the changes (5 to 10 minutes ) If the Karpenter Install runs well, continue.
tofu apply
  1. Update you kubectl config After apple the tofu configuration, update you kubeconfig to allow the usage of kubectl command and other utilities.
aws eks update-kubeconfig --region us-east-1 --name my-test-cluster --alias my-test-cluster

Cleaning Up the Environment

Option 1: Using OpenTofu

To destroy the resources created by the project, execute:

tofu destroy

Option 2: Using aws-nuke (Alternative)

Follow these steps to clean up resources using aws-nuke:

  1. Install aws-nuke: Install the tool via Homebrew:
brew install aws-nuke
  1. Configure nuke-example.yaml:
  • Add your AWS account ID to the configuration file.
  • Specify any IAM users or resources you want to exclude from deletion.
  1. Run aws-nuke: Execute the following command to clean up resources:
aws-nuke nuke -c nuke-example.yaml --no-dry-run

Important: Ensure your AWS account has an active account alias before running aws-nuke to avoid errors.

About

A minimal Terraform configuration designed to quickly deploy and test applications and infrastructure configurations on Amazon EKS (Elastic Kubernetes Service). Ideal for development, experimentation, and validation of Kubernetes-based workloads.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages