Overview
The EKS (Elastic Kubernetes Service) Module creates a fully-managed Kubernetes cluster on AWS with compute options (EC2 node groups or Fargate), essential add-ons, and OIDC-based service account authentication for the Artos platform. The cluster is configured for high security with private endpoints, encryption, and comprehensive logging.Key Features
- Private Cluster: API endpoint accessible only from within VPC
- Flexible Compute: Mix EC2 node groups and Fargate profiles based on workload needs
- Essential Add-ons: Pre-configured VPC CNI, CoreDNS, and kube-proxy
- OIDC Authentication: IAM roles for Kubernetes service accounts (IRSA)
- Encrypted Secrets: KMS encryption for Kubernetes secrets at rest
- Comprehensive Logging: All control plane logs sent to CloudWatch
Core Resources
1. EKS Cluster
The EKS cluster is the Kubernetes control plane managed by AWS, including the API server, scheduler, and controller manager. Key Configuration:- Kubernetes Version: Default 1.28 (configurable), usually set to >=1.31
- Endpoint Access: Private only (no public internet access)
- Authentication Mode:
API_AND_CONFIG_MAP(supports both OIDC and traditional aws-auth ConfigMap) - Secrets Encryption: KMS encryption for etcd secrets
Private Endpoint: With
endpoint_public_access = false, the Kubernetes API is only accessible from within the VPC. Use a bastion host or VPN for cluster administration. This significantly reduces the attack surface.api- API server audit logsaudit- Kubernetes audit logsauthenticator- Authentication attemptscontrollerManager- Controller manager logsscheduler- Scheduler decisions
/aws/eks/{cluster_name}/cluster
2. Compute Options
The module supports two types of compute for running Kubernetes workloads:EC2 Node Groups
Purpose: Traditional EC2 instances for running pods, giving full control over instance types and scaling. Configuration:- AMI: Amazon Linux 2 (AL2_x86_64)
- Disk Size: 50 GB GP3 per node
- Update Strategy: 25% max unavailable during updates
- Scaling: Managed by Kubernetes Cluster Autoscaler or manual adjustment
- General application workloads
- Artos document generation workloads
- Artos regeneration workflows
- Artos document editing functionality
Fargate Profiles
Purpose: Serverless compute that runs each pod in an isolated environment without managing EC2 instances. Configuration:- Pods matching the selector (namespace + labels) run on Fargate
- Each pod gets dedicated compute resources (no node sharing)
- AWS manages all infrastructure (no EC2 instances to maintain)
- General application workloads
- Artos document generation workloads
- Artos regeneration workflows
- Artos document editing functionality
- No DaemonSets support
- No privileged containers
- No hostNetwork or hostPort
- Limited to specific regions and availability zones
3. EKS Add-ons
Add-ons are essential Kubernetes components provided and managed by AWS.VPC CNI (vpc-cni)
Purpose: Enables pod networking using AWS VPC networking primitives (ENIs and secondary IPs).
Configuration:
- Prefix Delegation: Increases pod density per node by delegating IP prefixes instead of individual IPs
- Pod ENI: Allows pods to have dedicated Elastic Network Interfaces for advanced networking
CoreDNS (coredns)
Purpose: Provides DNS resolution for services and pods within the cluster.
How It Works:
- Runs as a deployment in the
kube-systemnamespace - Handles DNS queries like
service-name.namespace.svc.cluster.local - Integrates with VPC DNS for external domain resolution
kube-proxy (kube-proxy)
Purpose: Manages network rules on each node to enable Kubernetes service networking.
How It Works:
- Runs as a DaemonSet on every node
- Implements Kubernetes Service abstraction using iptables or IPVS
- Routes traffic to correct pods based on service selectors
4. OIDC Identity Provider
The OIDC (OpenID Connect) provider enables Kubernetes service accounts to assume AWS IAM roles. How It Works:- EKS cluster has an OIDC issuer URL (e.g.,
https://oidc.eks.us-east-1.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE) - AWS IAM trust policy references this OIDC provider
- Kubernetes service accounts annotated with IAM role ARN can assume the role
- Pods using these service accounts get temporary AWS credentials
- Application pods accessing S3, RDS, or other AWS services
- Add-on controllers (AWS Load Balancer Controller, EBS CSI Driver)
5. IAM Roles for Add-ons
Each add-on requiring AWS API access gets a dedicated IAM role using OIDC authentication.VPC CNI Role
Service Account:system:serviceaccount:kube-system:aws-node
Permissions: AmazonEKS_CNI_Policy (AWS managed policy)
Capabilities:
- Attach/detach ENIs to EC2 instances
- Assign secondary IP addresses
- Manage network interfaces for pod networking
CoreDNS Role
Service Account:system:serviceaccount:kube-system:coredns
Permissions: AmazonEKSClusterPolicy (AWS managed policy)
Capabilities:
- Describe cluster resources
- Access cluster configuration
EBS CSI Driver Role
Service Account:system:serviceaccount:kube-system:ebs-csi-controller-sa
Permissions: Custom policy for EBS operations
Capabilities:
- Create, attach, detach, and delete EBS volumes
- Create and delete snapshots
- Describe volumes and instances
- Manage volume tags
Module Configuration
Basic Configuration
Production Configuration with Mixed Compute
Development Configuration
Accessing the Cluster
Configure kubectl
Grant Additional IAM Users/Roles Access
The module usesbootstrap_cluster_creator_admin_permissions = false, meaning the cluster creator doesn’t automatically get admin access. You must explicitly grant access using EKS Access Entries or the aws-auth ConfigMap.
Option 1: EKS Access Entries (Recommended)
Related Modules
- Bastion Module - Secure access to EKS cluster management
- ECR Module - Container image registry for EKS workloads
- Networking Module - VPC and subnets for EKS cluster
- IAM Module - IAM roles for EKS and add-ons
- Monitoring Module - CloudWatch metrics and alarms
Module Maintenance: This module is compatible with Terraform 1.0+ and AWS Provider 5.x. The cluster uses Kubernetes 1.28 by default. Review AWS EKS release notes before upgrading cluster versions.