☁️ Cloud

EKS

Elastic Kubernetes Service

AWS's managed Kubernetes. Automatic management of the control plane. Fargate integration.

Detailed Explanation

Amazon EKS (Elastic Kubernetes Service) is a fully managed Kubernetes service provided by AWS. Because AWS manages the control plane (API server, etcd, scheduler), you can use production-grade Kubernetes without the operational burden.

Key components of EKS:

  • Control plane: AWS distributes it across 3 AZs and guarantees a 99.95% SLA. Billed at $0.10 per hour
  • Data plane (worker nodes): You can choose EC2 managed node groups, self-managed nodes, or Fargate
  • EKS Addons: AWS-managed add-ons such as CoreDNS, kube-proxy, and VPC CNI are provided
  • EKS Anywhere: Provides the same EKS experience on-premises as well

Node type comparison:

  • Managed node groups: AWS automates EC2 provisioning/updates. Most recommended
  • Fargate: Serverless, billed per Pod. Minimizes operational burden
  • Self-managed: You manage EC2 directly. Used when GPUs or special AMIs are required

Code Example

# eksctl로 EKS 클러스터 생성 (가장 간단한 방법) eksctl create cluster \ --name my-cluster \ --version 1.29 \ --region ap-northeast-2 \ --nodegroup-name standard-workers \ --node-type t3.medium \ --nodes 3 \ --nodes-min 2 \ --nodes-max 5 \ --managed # Fargate 프로파일 추가 eksctl create fargateprofile \ --cluster my-cluster \ --name fp-default \ --namespace default # 스팟 인스턴스 노드 그룹 추가 (비용 절감) eksctl create nodegroup \ --cluster my-cluster \ --name spot-workers \ --node-type t3.large \ --nodes 3 \ --spot \ --instance-types t3.large,t3a.large,m5.large # AWS Load Balancer Controller 설치 eksctl create iamserviceaccount \ --cluster=my-cluster \ --namespace=kube-system \ --name=aws-load-balancer-controller \ --attach-policy-arn=arn:aws:iam::aws:policy/ElasticLoadBalancingFullAccess \ --override-existing-serviceaccounts \ --approve # 클러스터 삭제 eksctl delete cluster --name my-cluster --region ap-northeast-2
# Terraform EKS 클러스터 구성 module "eks" { source = "terraform-aws-modules/eks/aws" version = "~> 20.0" cluster_name = "my-cluster" cluster_version = "1.29" cluster_endpoint_public_access = true vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets # 클러스터 애드온 cluster_addons = { coredns = { most_recent = true } kube-proxy = { most_recent = true } vpc-cni = { most_recent = true } } # 관리형 노드 그룹 eks_managed_node_groups = { # 일반 워크로드용 general = { instance_types = ["t3.medium"] capacity_type = "ON_DEMAND" min_size = 2 max_size = 10 desired_size = 3 labels = { workload = "general" } } # 스팟 인스턴스 (비용 절감) spot = { instance_types = ["t3.large", "t3a.large", "m5.large"] capacity_type = "SPOT" min_size = 0 max_size = 10 desired_size = 2 labels = { workload = "spot" } taints = [{ key = "spot" value = "true" effect = "NO_SCHEDULE" }] } } # Fargate 프로파일 fargate_profiles = { kube_system = { name = "kube-system" selectors = [ { namespace = "kube-system" } ] } } tags = { Environment = "production" Terraform = "true" } } # IRSA (IAM Roles for Service Accounts) module "irsa_s3" { source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks" version = "~> 5.0" role_name = "my-app-s3-role" oidc_providers = { main = { provider_arn = module.eks.oidc_provider_arn namespace_service_accounts = ["default:my-app"] } } role_policy_arns = { s3_read = "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess" } }
# kubeconfig 업데이트 aws eks update-kubeconfig \ --region ap-northeast-2 \ --name my-cluster # 클러스터 정보 확인 kubectl cluster-info kubectl get nodes -o wide # EKS 네임스페이스별 Pod 배치 확인 kubectl get pods -A -o wide # EKS에서 ALB Ingress 사용 cat <<EOF | kubectl apply -f - apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-app-ingress annotations: kubernetes.io/ingress.class: alb alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/target-type: ip spec: rules: - http: paths: - path: / pathType: Prefix backend: service: name: my-app port: number: 80 EOF # IRSA로 Pod에 AWS 권한 부여 cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ServiceAccount metadata: name: my-app annotations: eks.amazonaws.com/role-arn: arn:aws:iam::123456789:role/my-app-s3-role --- apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: serviceAccountName: my-app # IRSA 연결 containers: - name: app image: my-app:latest # AWS SDK가 자동으로 IRSA 자격 증명 사용 EOF # 노드 그룹 스케일링 kubectl scale deployment my-app --replicas=10

Practical Conversation Example

Choosing a cluster
"EKS vs self-built Kubernetes, which is better?" "If your operations team has 3 or fewer people, I strongly recommend EKS. AWS handles control plane management, upgrades, and security patches for you. Even though $0.10 per hour (about $72 per month) may look expensive, it's much cheaper when you consider SRE labor costs. However, worker node costs are charged at the regular EC2 rates."
Cost optimization discussion
"I want to reduce EKS node costs. Is there a way?" "There are three strategies. First, mixing Spot Instances into managed node groups can save up to 90%. If you install Karpenter, it automatically selects the optimal Spot type. Second, Fargate is billed per Pod, so it's advantageous for services with large traffic fluctuations. Third, use Cluster Autoscaler to scale down nodes at night and on weekends."
Security design review
"How do you grant access to AWS services in EKS?" "Use IRSA (IAM Roles for Service Accounts). Because it attaches an IAM Role directly to a Pod, there is no risk of exposing Access Keys. If you specify the Role ARN as an annotation on the ServiceAccount, the SDK exchanges tokens automatically. Never put Access Keys in a Secret."
Interview question
"What is the difference between EKS and ECS?" "ECS is an AWS-native container orchestrator, so it is easier to integrate with AWS services and has a lower learning curve. EKS is standard Kubernetes, so it is advantageous for multi-cloud/hybrid, and you can use the CNCF ecosystem such as Helm and Istio as is. It's common to start with EKS if your team already has K8s experience, and with ECS if not."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

Cautions

⚠️
Cluster upgrades: EKS supports each K8s minor version for only 14 months. If you leave it unattended without an upgrade plan, support will end. Set up a quarterly upgrade schedule.
⚠️
VPC CNI IP exhaustion: EKS's VPC CNI assigns an ENI Secondary IP to each Pod. A /24 subnet (254 IPs) runs out quickly, so design with /20 or larger or enable Prefix Delegation.
⚠️
aws-auth ConfigMap: Node IAM Roles and user access permissions are managed in the kube-system/aws-auth ConfigMap. If you delete it by mistake, cluster access may be blocked, so a backup is essential.
⚠️
Fargate limitations: Fargate does not support DaemonSet or GPU, and has a limit of up to 4 vCPU/30GB of memory. Deploy monitoring agents as sidecars.

Related Terms

Learn More