How cralonsobcn/cralonsobcn-tf-eks-project works
Main Components
• Terraform Module/Files: The terraform directory encapsulates all the infrastructure definitions, split into several logical segments:
• controlplane.tf: Configures the EKS control plane.
• dataplane.tf: Manages the EC2 Autoscaling Group for worker (data) nodes.
• networking.tf: Sets up VPC, subnets, internet gateways, route tables, and security groups.
• iam.tf: Defines the necessary IAM roles and policies.
• providers.tf and variables.tf: Establish the configuration environment and variable management.
• userdata.sh: Contains the EC2 launch script/workaround for node joining.
• aws-auth-cm.yaml: Configures the mapping between IAM roles and Kubernetes RBAC.
• Deployment Prerequisites: Represent the script.sh which ensures the environment has AWS CLI, Terraform, and kubectl – vital tools to interact with AWS services and manage the cluster.
• AWS Services: Emphasize the use of key AWS services and resources such as:
• EKS (Kubernetes control plane)
• EC2 (worker nodes via autoscaling)
• S3 (Terraform state storage)
• IAM (roles & policies for secure access)
• VPC, Subnets, Internet Gateway, and Load Balancers (ALB/NLB as created by AWS LoadBalancer Controller).
Relationships and Interactions
• That the AWS account (or user) triggers the deployment process (using the prerequisites checked via script.sh) which then kicks off Terraform runs, culminating in the creation of the EKS cluster and autoscaling node group.
• Demonstrate the dependency where the output of the Terraform execution (like the dataplane-role-arn) is used to update the aws-auth-cm.yaml, binding worker node credentials to the cluster.
Architectural Patterns/Design Principles
• Infrastructure-as-Code: The entire design is modularized into Terraform files, reflecting a declarative and reusable pattern.
• Separation of Concerns: Networking, compute, and IAM are split into different files, emphasizing clarity.
• High Availability: The design spans multiple Availability Zones and uses autoscaling to ensure resilience.
• Automation and Self-Healing: The shell script automates prerequisite validation and key resource provisioning (e.g., S3 bucket for state management).
Technologies and Frameworks
• Terraform (for IaC)
• AWS Services (EKS, EC2, S3, IAM, VPC)
• Bash (via script.sh for automation)
• kubectl (for managing Kubernetes resources)
• External integrations like AWS LoadBalancer Controller are also pertinent.
Essential Elements
• “Terraform Module” containing submodules for networking, control plane, dataplane, IAM.
• “AWS VPC & Networking” (including subnets, internet gateway, route tables).
• “EKS Cluster” (control plane) and “EC2 Autoscaling Group” (worker nodes).
• “IAM Roles/Policies” (connecting the dataplane and cluster).
• “Terraform State Management” with S3 Bucket.
• “Prerequisite Checker” (script.sh).
• Infrastructure as Code artifacts (like Terraform files/components)
• AWS managed services (EKS, EC2, S3, etc.)
• Automation/operational scripts (e.g., script.sh, userdata.sh)
• Annotations or side notes to emphasize architectural choices like high availability (multi-AZ), auto-scaling, and the automation required for updating node credentials.