EKS interview question · Most asked
How do you provision EKS clusters as code?
Summary
With infrastructure-as-code tools: Terraform or OpenTofu (commonly the community terraform-aws-modules/eks module), AWS CloudFormation or CDK, eksctl (a CLI that generates CloudFormation), or Crossplane and Cluster API from Kubernetes itself. Then install cluster add-ons and workloads with GitOps.
Longer Answer
A typical split: IaC creates the VPC, cluster, node pools or Karpenter prerequisites, IAM roles, access entries and EKS add-ons; a GitOps tool (Argo CD, Flux) bootstraps in-cluster components (ingress, cert-manager, external-secrets, monitoring) and applications. Keep cluster definitions modular so new environments are repeatable, and keep Kubernetes resources out of Terraform where possible to avoid two tools fighting over the same objects.
Key Points
- Terraform/OpenTofu, CDK/CloudFormation, eksctl.
- IaC for AWS resources; GitOps for in-cluster.
- Repeatable environments.
- Avoid managing in-cluster objects from two tools.
Deep dive: Terraform interview questions
More most-asked EKS questions
- What is Amazon EKS, and what does AWS manage versus what do you manage?
- Compare the EKS compute options: managed node groups, self-managed nodes, Fargate, Karpenter and EKS Auto Mode.
- How does the Amazon VPC CNI work, and why do EKS clusters run out of IP addresses?
- IRSA or EKS Pod Identity: how do pods get AWS permissions?
- How do you expose services on EKS? Explain the AWS Load Balancer Controller.
- How do you upgrade an EKS cluster, and what are standard and extended support?
- Why is Karpenter popular on EKS, and how does it differ from the Cluster Autoscaler?
- How do you secure an EKS cluster end to end?