Skip to main content

Amazon EKS - Elastic Kubernetes Service (2026 Edition)

Total Questions: 60 Curriculum: Core Fundamentals (100), Intermediate (120), Advanced (80)


Core Fundamentals​

Q1: What is Amazon EKS and how does it differ from self-managed Kubernetes?​

Technical Answer: Amazon EKS is a managed Kubernetes service that runs upstream Kubernetes without modification. AWS manages the control plane (API server, etcd, scheduler) while you manage worker nodes. Unlike self-managed, EKS provides high availability, patching, and integration with AWS services.

Architecture Comparison:

AspectEKSSelf-Managed Kubernetes
Control PlaneAWS managedSelf-managed
etcdAWS managedSelf-managed
Node ManagementYou manageYou manage
High AvailabilityMulti-AZ by defaultMust configure
PatchingAutomatedManual
PricingControl plane + nodesNodes only

EKS Cluster Creation:

# Install eksctl
curl --silent --location "https://github.com/weaveworks/eksctl/install.sh" | bash

# Create cluster
eksctl create cluster \
--name production-cluster \
--version 1.30 \
--region us-east-1 \
--nodegroup-name linux-nodes \
--node-type m6i.large \
--nodes 3 \
--nodes-min 1 \
--nodes-max 10 \
--managed \
--spot \
--spot-max-price 0.05

# Verify connection
kubectl get nodes
kubectl get svc

Fargate Profile (Serverless):

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: fargate-cluster
region: us-west-2
fargateProfiles:
- name: fp-default
selectors:
- namespace: kube-system
- namespace: default
- namespace: production

🔍 Interviewer Notes: Testing managed service understanding and architecture decisions.

❌ Common Mistakes:

  • Not enabling IMDSv2 on nodes
  • Using too many managed node groups
  • Not considering Fargate for burst workloads

Q2: How to manage EKS node groups and scaling?​

Technical Answer: EKS node groups can be managed or self-managed. Managed node groups provide integrated autoscaling through Cluster Autoscaler. For cost optimization, consider Spot instances with mixed instance policies.

Node Group Configuration:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: scalable-cluster
region: us-east-1
nodeGroups:
- name: ng-spot-linux
instanceType: m6i.large
desiredCapacity: 3
minSize: 1
maxSize: 20
spot: true
labels:
lifecycle: Ec2Spot
intent: apps
taints:
spotInstance: true:PreferNoSchedule
iam:
withAddonPolicies:
autoScaler: true
cloudWatch: true
albIngress: true
ssh:
allow: true
publicKeyPath: ~/.ssh/id_rsa.pub

Cluster Autoscaler Setup:

# Install Cluster Autoscaler
helm repo add autoscaler https://kubernetes.github.io/autoscaler
helm install cluster-autoscaler autoscaler/cluster-autoscaler \
--namespace kube-system \
--set autoDiscovery.clusterName=scalable-cluster \
--set awsRegion=us-east-1 \
--set extraArgs.balance-similar-node-groups=true \
--set rbac.serviceAccount.create=true \
--set rbac.serviceAccount.name=cluster-autoscaler

# IAM policy for autoscaling
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:SetInstanceHealth",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeLaunchTemplateVersions"
],
"Resource": "*"
}
]
}

HPA Configuration:

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api-deployment
minReplicas: 2
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 10
periodSeconds: 60

🔍 Interviewer Notes: Testing scaling strategy and configuration knowledge.

❌ Common Mistakes:

  • Not setting proper PDBs before scaling
  • HPA target too aggressive
  • Spot interruption handling missing

Q3: How to implement EKS networking with VPC and security?​

Technical Answer: EKS networking involves VPC CNI plugin, security groups, and network policies. The VPC CNI assigns VPC IPs to pods, enabling native VPC security. Network policies provide pod-level firewall rules.

VPC Configuration:

# Cluster with custom VPC
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: custom-vpc-cluster
vpc:
cidr: "10.10.0.0/16"
subnets:
private:
us-east-1a: { cidr: "10.10.0.0/19" }
us-east-1b: { cidr: "10.10.32.0/19" }
public:
us-east-1a: { cidr: "10.10.64.0/19" }
us-east-1b: { cidr: "10.10.96.0/19" }
clusterEndpoints:
privateAccess: true
publicAccess: false
securityGroupIds: ["sg-12345"]

Security Group Rules:

# Terraform example
resource "aws_security_group_rule" "node_ingress" {
type = "ingress"
from_port = 0
to_port = 65535
protocol = "tcp"
source_security_group_id = aws_eks_cluster.cluster.vpc_config[0].cluster_security_group_id
security_group_id = aws_eks_node_group.nodes[0].resources[0].remote_access_security_group_id
}

Network Policy Example:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: api-allow-specific
spec:
podSelector:
matchLabels:
app: api
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: frontend
- podSelector:
matchLabels:
role: monitoring
ports:
- protocol: TCP
port: 8080
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-all
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress

🔍 Interviewer Notes: Testing network security and isolation understanding.

❌ Common Mistakes:

  • Not isolating control plane endpoints
  • Missing network policy for egress
  • Too permissive security group rules

Q4: How to manage EKS workloads and deployments?​

Technical Answer: EKS workload management involves Deployments, StatefulSets, DaemonSets, and Jobs. Each workload type serves different purposes. Understanding update strategies, resource limits, and health checks is essential.

Deployment Patterns:

apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values: ["web"]
topologyKey: kubernetes.io/hostname
containers:
- name: web
image: nginx:1.25
ports:
- containerPort: 80
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
livenessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 80
initialDelaySeconds: 5
periodSeconds: 5

StatefulSet Example:

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mongodb
spec:
serviceName: mongodb
replicas: 3
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo:7
ports:
- containerPort: 27017
volumeMounts:
- name: mongodb-data
mountPath: /data/db
volumeClaimTemplates:
- metadata:
name: mongodb-data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: gp3
resources:
requests:
storage: 10Gi

Canary Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
name: app-v2-canary
spec:
replicas: 1 # Small percentage
selector:
matchLabels:
app: app
version: v2
template:
metadata:
labels:
app: app
version: v2
spec:
containers:
- name: app
image: app:v2.0.0
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: app-canary
spec:
hosts:
- app.example.com
http:
- route:
- destination:
host: app
subset: v1
weight: 90
- destination:
host: app
subset: v2
weight: 10

🔍 Interviewer Notes: Testing deployment strategy knowledge.

❌ Common Mistakes:

  • Not setting proper resource limits
  • Liveness probe too aggressive (crash loops)
  • Ignoring pod disruption budgets

Q5: How to handle EKS storage and persistence?​

Technical Answer: EKS storage options include EBS volumes, EFS for shared storage, and FSx for high-performance workloads. StorageClasses define dynamic provisioning. Volume snapshots enable backup and cloning.

StorageClass Examples:

# gp3 (recommended for most workloads)
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3-encrypted
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
type: gp3
iopsPerGB: "50"
encrypted: "true"
fsType: ext4
---
# EFS for shared access
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: efs-sc
provisioner: efs.csi.aws.com
---
# io2 for high IOPS
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: io2-high-iops
provisioner: ebs.csi.aws.com
parameters:
type: io2
iopsPerGB: "100"
fsType: ext4

PersistentVolumeClaim:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: database-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: gp3-encrypted
resources:
requests:
storage: 100Gi

Snapshot and Restore:

# VolumeSnapshotClass
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: ebs-snapshot
driver: ebs.csi.aws.com
deletionPolicy: Retain
---
# Create snapshot
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: database-snapshot
spec:
volumeSnapshotClassName: ebs-snapshot
source:
persistentVolumeClaimName: database-pvc
---
# Restore from snapshot
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: database-restore
spec:
dataSource:
name: database-snapshot
kind: VolumeSnapshot
apiGroup: snapshot.storage.k8s.io
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi

🔍 Interviewer Notes: Testing storage architecture decisions.

❌ Common Mistakes:

  • Not using WaitForFirstConsumer binding
  • Snapshots not retained properly
  • Wrong access mode for workload type

Q6: What is the EKS pod lifecycle and how to manage it?​

Technical Answer: EKS pod lifecycle involves phases (Pending, Running, Succeeded, Failed) and readiness states. Understanding init containers, lifecycle hooks, and termination handling is crucial for reliable deployments.

Pod Lifecycle Management:

apiVersion: v1
kind: Pod
metadata:
name: lifecycle-demo
spec:
initContainers:
- name: init-myservice
image: busybox
command:
["sh", "-c", "until nslookup myservice; do echo waiting; sleep 2; done"]
containers:
- name: main-container
image: nginx
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "echo 'Started' > /tmp/status"]
preStop:
exec:
command: ["/bin/sh", "-c", "sleep 30"]
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 30
periodSeconds: 30

Termination Handling:

apiVersion: apps/v1
kind: Deployment
metadata:
name: graceful-shutdown
spec:
replicas: 3
template:
spec:
terminationGracePeriodSeconds: 60
containers:
- name: app
image: myapp:latest
lifecycle:
preStop:
exec:
# Handle in-flight requests gracefully
command: ["/bin/sh", "-c", "sleep 15"]

Pod Disruption Budget:

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: app-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app: app

🔍 Interviewer Notes: Testing reliability and graceful degradation patterns.

❌ Common Mistakes:

  • Not handling SIGTERM properly
  • PreStop hook blocking too long
  • PDB not set before node maintenance

Q7: How to implement EKS security and compliance?​

Technical Answer: EKS security involves IAM roles for service accounts, network policies, pod security standards, and image scanning. CIS benchmarks provide hardening guidelines. Secrets management requires external stores.

IAM Roles for Service Accounts (IRSA):

# IAM Role for Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: s3-reader-sa
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789:role/EKS-S3Reader
---
# Use in pod
apiVersion: v1
kind: Pod
metadata:
name: s3-reader
spec:
serviceAccountName: s3-reader-sa
containers:
- name: app
image: app:v1
env:
- name: AWS_REGION
value: us-east-1

Pod Security Standards:

apiVersion: v1
kind: Namespace
metadata:
name: restricted
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restricted
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: restricted-app
namespace: restricted
spec:
template:
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: app:v1
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1000

Image Scanning Integration:

# Trivy scanner as admission controller
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: trivy-scanner
webhooks:
- name: trivy.k8s.tips
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
clientConfig:
service:
namespace: kube-system
name: trivy-scanner
admissionReviewVersions: ["v1"]
sideEffects: None
timeoutSeconds: 30

🔍 Interviewer Notes: Testing security implementation depth.

❌ Common Mistakes:

  • Static pod IAM credentials
  • No image vulnerability scanning
  • Debug containers with privileged access

Q8: How to monitor EKS clusters and troubleshoot issues?​

Technical Answer: EKS monitoring combines Prometheus for metrics, CloudWatch for logs, and OpenTelemetry for traces. CoreDNS, kube-proxy, and node-level metrics require specific attention. Troubleshooting involves pod status, events, and resource usage.

Monitoring Stack:

# Install Prometheus with Helm
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/kube-prometheus-stack \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false

# CoreDNS metrics
kubectl patch svc kube-dns -n kube-system -p '{"spec":{"ports":[{"name":"metrics","port":9153,"protocol":"TCP"}]}}'

# CloudWatch logs
eksctl utils associate-iam-oidc-provider --cluster my-cluster --approve
helm install aws-for-fluent-bit eks/aws-for-fluent-bit

Troubleshooting Commands:

# Pod debugging
kubectl describe pod <pod-name>
kubectl logs <pod-name> --previous
kubectl exec -it <pod-name> -- /bin/sh

# Resource usage
kubectl top nodes
kubectl top pods -n <namespace>

# Events
kubectl get events --sort-by='.lastTimestamp'

# Node issues
kubectl describe node <node-name>
ssh ec2-user@<node-ip> 'sudo journalctl -u kubelet -n 100'

Common Issues and Solutions:

# Image pull errors
# Check image name, tag, registry credentials
kubectl describe pod <pod> | grep -A5 -B5 "ImagePullBackOff"

# CrashLoopBackOff
# Check liveness probe, resource limits, app logs
kubectl logs <pod> --previous

# Pending pods
# Check node resources, affinity, taints
kubectl describe pod <pod> | grep -A10 "Events"

🔍 Interviewer Notes: Testing troubleshooting methodology.

❌ Common Mistakes:

  • Not checking events for root cause
  • Ignoring pending pod reasons
  • Missing resource requests/limits

Q9: How to upgrade and maintain EKS clusters?​

Technical Answer: EKS upgrades follow control plane first, then node groups. Version skew policy allows one minor version difference. Blue-green deployments with new node groups reduce downtime. Add-ons require separate upgrade planning.

Upgrade Process:

# Check current version
eksctl get cluster --region us-east-1

# Update control plane
eksctl upgrade cluster --name my-cluster --region us-east-1 --version 1.30

# Create new node group (blue-green)
eksctl create nodegroup \
--cluster my-cluster \
--name ng-new-version \
--node-type m6i.large \
--nodes 3

# Migrate workloads
kubectl taint nodes old-node-group --all:NoSchedule

# Delete old node group
eksctl delete nodegroup --cluster my-cluster --name ng-old-version

Version Compatibility Matrix:

# Check compatibility before upgrade
eksctl utils write-kubeconfig --cluster my-cluster
kubectl version --short
eksctl get cluster --region us-east-1 -o jsonpath='{.Clusters[0].Version}'

🔍 Interviewer Notes: Testing operational maturity and upgrade planning.

❌ Common Mistakes:

  • Upgrading without testing workloads
  • Not checking addon compatibility
  • Skipping node group upgrades

Q10: How to optimize EKS costs?​

Technical Answer: EKS cost optimization involves right-sizing, Spot instances for fault-tolerant workloads, Fargate for burst capacity, and resource bin packing. Savings Plans provide discounts for predictable usage.

Cost Optimization Strategies:

# Spot instance node group with fallback
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
nodeGroups:
- name: ng-spot-primary
instanceTypes: ["m6i.large", "m5.large", "m5a.large"]
spot: true
desiredCapacity: 5
minSize: 2
maxSize: 20
labels:
lifecycle: Ec2Spot
taints:
spotInstance: true:PreferNoSchedule

# Resource quotas for namespace
apiVersion: v1
kind: ResourceQuota
metadata:
name: compute-resources
namespace: development
spec:
hard:
requests.cpu: "1"
requests.memory: 1Gi
limits.cpu: "2"
limits.memory: 2Gi

Cost Monitoring:

# Enable Container Insights
aws eks update-cluster-config \
--region us-east-1 \
--name my-cluster \
--logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'

# Rightsizing recommendations
aws compute-optimizer get-ec2-recommendation

🔍 Interviewer Notes: Testing cost awareness and optimization practices.

❌ Common Mistakes:

  • Over-provisioned resources
  • Not using Spot for suitable workloads
  • Missing resource quotas

Q11: What is the EKS control plane and who manages it?​

Technical Answer: The EKS control plane (API server, etcd, scheduler, controllers) is fully managed by AWS — you never SSH into it. AWS runs it across multiple AZs, handles upgrades, and secures it. You only manage worker nodes (EC2/Fargate), add-ons, and workloads. The control plane endpoint can be public or private (or both).

Key points:

  • etcd is encrypted at rest, managed by AWS
  • Control plane upgrades are AWS-driven; you schedule with maintenance windows
  • Worker nodes connect via the API endpoint + IAM auth (aws eks update-kubeconfig)
  • You pay a control plane fee per cluster (~$0.10/hr) plus node costs

Code/Syntax Justification:

# Private-only endpoint
aws eks update-cluster-config --name my-cluster --resources-vpc-config endpointPublicAccess=false,endpointPrivateAccess=true

🔍 Behind the Question: Understanding managed control plane vs self-managed trade-offs. ❌ The Red Flags: Thinking you can patch/manage the control plane directly.

Q12: What is Fargate vs EC2 node groups in EKS?​

Technical Answer: EC2 node groups: you provision and manage worker nodes (or use managed node groups where AWS handles scaling/upgrades). Fargate: serverless compute — AWS provisions pods directly without nodes you manage, using a Fargate profile that matches pods by namespace/labels.

Trade-offs:

  • Fargate: no node management, pay per pod, no DaemonSets, limited to Linux, no privileged pods — best for bursty or small workloads
  • EC2: full control (GPUs, custom AMIs, DaemonSets, privileged), better cost efficiency at scale with bin-packing + Spot

Code/Syntax Justification:

# Fargate profile
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
fargateProfiles:
- name: fp-default
selectors:
- namespace: fargate-ns

🔍 Behind the Question: Compute model selection and constraints. ❌ The Red Flags: Assuming DaemonSets/privileged pods work on Fargate.

Q13: What is IRSA (IAM Roles for Service Accounts) and why use it?​

Technical Answer: IRSA lets a Kubernetes ServiceAccount assume an IAM role — pods get AWS credentials via OIDC federation instead of long-lived keys. You create an IAM role with a trust policy allowing the OIDC issuer + service account, then reference it in the pod spec. This is the modern, least-privilege way to give pods AWS access.

Code/Syntax Justification:

apiVersion: v1
kind: ServiceAccount
metadata:
name: s3-access-sa
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/pod-s3-role
---
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
serviceAccountName: s3-access-sa

🔍 Behind the Question: Secure pod-to-AWS auth, avoiding hardcoded keys. ❌ The Red Flags: Mounting long-lived AWS keys in pods.

Q14: What is the difference between a NodePort, LoadBalancer, and Ingress in EKS?​

Technical Answer:

  • NodePort: exposes a service on a static port on every node (external access via nodeIP:port) — for testing
  • LoadBalancer: provisions an AWS NLB/CLB pointing at the service — one LB per Service, no routing rules
  • Ingress: an API object (Ingress Controller, e.g., ALB Ingress Controller / NGINX) that routes HTTP/HTTPS by host/path to multiple Services — the production choice for web traffic

Code/Syntax Justification:

# ALB Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
spec:
rules:
- host: api.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api-svc
port:
number: 80

🔍 Behind the Question: Networking exposure layers and production routing. ❌ The Red Flags: Creating one LoadBalancer per service at scale.

Q15: How do you handle EKS upgrades safely?​

Technical Answer: Upgrade in order: control plane first, then node groups, then add-ons. Use multiple node groups for in-place replacement (new AMI/version nodes join, drain old ones). Test in a staging cluster. Use eksctl upgrade cluster / aws eks update-cluster-version, and verify pod disruption budgets.

Safe upgrade checklist:

  • Read EKS version upgrade notes (K8s API removals, add-on compat)
  • Upgrade control plane (max 2 minor versions at a time)
  • Upgrade add-ons (CNI, kube-proxy, CoreDNS, CSI) — match versions
  • Roll node groups: new AMI + version, cordon/drain old
  • Run conformance tests + smoke tests after each step
eksctl upgrade cluster --name my-cluster --version 1.31
eksctl upgrade nodegroup --cluster my-cluster --name ng-1 --kubernetes-version 1.31

🔍 Behind the Question: Upgrade risk management and version compatibility. ❌ The Red Flags: Upgrading nodes before control plane, skipping add-ons.

Q16: What is Cluster Autoscaler vs Karpenter?​

Technical Answer: Both add/remove nodes based on pending pods.

  • Cluster Autoscaler: adjusts node groups within min/max based on unschedulable pods; slower (minute-scale), works with existing node groups
  • Karpenter: provisions optimal instances directly (right-sized, fast, consolidation, Spot/On-Demand mix) without node group templates; faster, more efficient, the modern choice

Code/Syntax Justification:

# Karpenter provisioner
apiVersion: karpenter.sh/v1beta1
kind: NodePool
metadata:
name: default
spec:
template:
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand", "spot"]
nodeClassRef:
name: default
disruption:
consolidationPolicy: WhenUnderutilized

🔍 Behind the Question: Node provisioning strategies and efficiency. ❌ The Red Flags: Running both autoscalers together without coordination.

Q17: How do you enforce pod security in EKS?​

Technical Answer: Apply Pod Security Standards (restricted/baseline) via namespace labels or admission controllers, block privileged containers, enforce seccomp/AppArmor, and use securityContext in pod specs. On EKS, also gate image pulls and scan images (Trivy/EKS image scanning). Add policy engines (Kyverno/OPA) for fine-grained rules.

Code/Syntax Justification:

# Namespace restricted standard
apiVersion: v1
kind: Namespace
metadata:
name: prod
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restricted
---
# Pod security context
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
drop: ["ALL"]

🔍 Behind the Question: Runtime hardening and policy-as-code. ❌ The Red Flags: Running everything privileged with host access.

Q18: What is the AWS Load Balancer Controller and what does it manage?​

Technical Answer: The AWS Load Balancer Controller (successor to ALB Ingress Controller) provisions ALB/NLB based on Kubernetes Ingress/Service resources, and also manages TargetGroupBindings, listeners, rules, and mTLS for NLBs. It enables path/host routing to Services and integrates with AWS WAF, ACM certificates, and access logs.

Code/Syntax Justification:

# Install via Helm
helm repo add eks https://aws.github.io/eks-charts
helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=my-cluster

🔍 Behind the Question: Ingress/LB integration and managed controllers. ❌ The Red Flags: Manual ALB management outside Kubernetes.

Q19: How do you handle EKS storage with CSI drivers?​

Technical Answer: Use CSI drivers for persistence: EBS CSI (block storage per AZ), EFS CSI (shared POSIX across nodes), FSx for Lustre (HPC), EBS snapshots via VolumeSnapshot. Install aws-ebs-csi-driver as add-on; StorageClass defines type (gp3 default, io2 for high IOPS). Stateful workloads use PVCs bound to EBS volumes in the pod's AZ.

Code/Syntax Justification:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
type: gp3
fsType: ext4

🔍 Behind the Question: Stateful storage patterns and AZ constraints. ❌ The Red Flags: Using EBS across AZs; missing WaitForFirstConsumer.

Q20: What is Bottlerocket and why would you use it for EKS nodes?​

Technical Answer: Bottlerocket is AWS's Linux micro-OS built specifically to run containers: minimal, read-only root filesystem, automatic updates, no shell/SSH by default, focused security. It reduces attack surface and improves node consistency for EKS/ECS. Trade-off: less debuggability (SSH via admin container only), some tooling incompatibility.

Code/Syntax Justification:

# eksctl managed node group with Bottlerocket
nodeGroups:
- name: ng-bottlerocket
amiFamily: Bottlerocket
instanceType: m6i.large

🔍 Behind the Question: Node OS choice and security posture. ❌ The Red Flags: Choosing a general-purpose OS when Bottlerocket suffices.

Q21: How do you implement multi-cluster EKS (fleet) management?​

Technical Answer: Run multiple EKS clusters per environment/region/business unit for isolation and blast-radius control. Manage fleets with GitOps (Argo CD/Flux) for consistent deployments, EKS Connector/Anywhere for hybrid, and cluster sets for policy propagation. Route traffic with AWS Global Accelerator or Service Mesh for multi-cluster service discovery.

Key patterns:

  • One cluster per env (dev/staging/prod)
  • One cluster per team/tenant for hard isolation
  • GitOps repo per cluster or shared app-of-apps
  • Cross-cluster traffic via VPN/Direct Connect or mesh federation

🔍 Behind the Question: Cluster strategy and operational scale. ❌ The Red Flags: One giant cluster with no isolation boundaries.

Q22: What is the difference between kubectl drain, cordon, and delete node?​

Technical Answer:

  • cordon: mark node unschedulable — no new pods, existing keep running
  • drain: cordon + evict all pods (respecting PDBs) — used before maintenance/deletion
  • delete node: remove the node object (worker re-registers on restart in EKS; for EC2, terminate the instance)

Code/Syntax Justification:

kubectl cordon ip-10-0-1-5.ec2.internal
kubectl drain ip-10-0-1-5.ec2.internal --ignore-daemonsets --delete-emptydir-data
# Wait for evictions, then terminate/delete
kubectl delete node ip-10-0-1-5.ec2.internal

🔍 Behind the Question: Node lifecycle operations and safe maintenance. ❌ The Red Flags: Deleting nodes without draining (pod data loss).

Q23: How do you implement zero-downtime deployments in EKS?​

Technical Answer: Use rolling updates with readiness gates, maxSurge/maxUnavailable, and PDBs for stateful pods. Blue-green or canary via Argo Rollouts for riskier releases. Ensure Services point to healthy pods only via readiness probes. Multi-AZ deployments survive AZ failure.

Code/Syntax Justification:

strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app: api

🔍 Behind the Question: Deployment strategies and availability guarantees. ❌ The Red Flags: Recreate strategy; no PDBs for stateful workloads.

Q24: How do you observe EKS clusters (metrics, logs, traces)?​

Technical Answer: Use CloudWatch Container Insights (metrics/logs), AWS X-Ray (traces via SDK/agent), Prometheus + Grafana (self-hosted or Amazon Managed Prometheus), and OpenTelemetry collectors for unified telemetry. Enable API server audit logging. Monitor node/pod resource utilization, control plane health, and workload SLOs.

Code/Syntax Justification:

# Container Insights
eksctl utils update-cluster-logging --enable-types=all --cluster my-cluster
# Prometheus via Helm
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring

🔍 Behind the Question: Observability stack and control plane visibility. ❌ The Red Flags: No audit logging; no workload-level SLOs.

Q25: What are EKS add-ons and why use them?​

Technical Answer: EKS add-ons are AWS-managed installs/upgrades of common components: VPC CNI, kube-proxy, CoreDNS, EBS CSI, EFS CSI, and observability agents. Using managed add-ons means AWS handles versioning and patching, reducing operational burden vs installing via Helm yourself.

Code/Syntax Justification:

eksctl create addon --cluster my-cluster --name aws-ebs-csi-driver

🔍 Behind the Question: Managed component lifecycle. ❌ The Red Flags: Manually managing add-on versions with drift.

Q26: How do you run stateful databases on EKS?​

Technical Answer: Run databases on EKS via StatefulSets with stable identities and per-pod PVCs (EBS), or operators (Postgres Operator, Zalando, KubeDB). Requirements: PDBs, backup/restore (snapshots + WAL), monitoring, proper resource requests, anti-affinity across AZs, and careful upgrades. For critical DBs, many teams still prefer managed RDS/Aurora for ops leverage.

Code/Syntax Justification:

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
serviceName: postgres
replicas: 3
podManagementPolicy: OrderedReady
template:
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: postgres
topologyKey: topology.kubernetes.io/zone

🔍 Behind the Question: Stateful workload design on Kubernetes. ❌ The Red Flags: No backups, no PDBs, no anti-affinity for databases.

Q27: What is the difference between eksctl and Terraform for EKS?​

Technical Answer: eksctl: purpose-built CLI that creates clusters/node groups quickly with sensible defaults — great for dev/experiments. Terraform: declarative IaC for full control and consistency across all AWS resources (VPC, IAM, node groups, add-ons) — the standard for production GitOps. Many teams use Terraform for infrastructure and eksctl for quick scratch clusters.

🔍 Behind the Question: Tool selection for cluster lifecycle. ❌ The Red Flags: Managing production clusters with click-ops or ad-hoc commands.

Q28: How do you restrict pod-to-pod and pod-to-service traffic in EKS?​

Technical Answer: NetworkPolicies (Calico/Cilium CNI) define allowed ingress/egress between pods; Security Groups for Pods (VPC CNI) attach AWS SGs directly to pods for integration with AWS network controls. Default-deny + explicit allow is the secure baseline.

Code/Syntax Justification:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-all
namespace: api
spec:
podSelector: {}
policyTypes: [Ingress, Egress]

🔍 Behind the Question: Network segmentation and zero trust in-cluster. ❌ The Red Flags: Open pod-to-pod traffic with no policy.

Q29: What is EKS Anywhere and when is it used?​

Technical Answer: EKS Anywhere lets you run EKS on your own on-premises infrastructure (VMware, bare metal) with the same APIs and tooling, for workloads that must stay on-prem (latency, compliance, data residency). Trade-offs: you manage the control plane and upgrades yourself — it is not fully managed like EKS on AWS.

🔍 Behind the Question: Hybrid/on-prem Kubernetes strategy. ❌ The Red Flags: Choosing EKS Anywhere without on-prem requirements.

Q30: How do you design a secure EKS networking topology?​

Technical Answer: Use private subnets for nodes and workloads (no public IPs), private-only control plane endpoint or restrict public endpoint with CIDR allowlist, NAT gateway for outbound, security groups (SG) per node group with least privilege, and VPC endpoints (S3, ECR, DynamoDB) to avoid NAT traffic. Route internet-facing traffic through ALB in public subnets.

Code/Syntax Justification:

# Private node groups
eksctl create cluster --name secure-cluster --node-private-networking --managed --vpc-private-subnets subnet-a,subnet-b

🔍 Behind the Question: Defense-in-depth network architecture. ❌ The Red Flags: Public subnets for nodes; wide-open security groups.


Senior / Principal — Real World Scenarios​

Q31: Pod stuck in CrashLoopBackOff — debugging the root cause​

Level: Senior

Scenario: A deployment's pods restart repeatedly (CrashLoopBackOff). The application logs show nothing useful. The team keeps restarting pods without fixing the issue.

Impact: Service unavailable. Wasted engineering time on restarts instead of root cause.

Root Cause: The container entrypoint crashes immediately (bad config, missing dependency, failed DB connection, crash on startup). Kubernetes restarts it with backoff delay. Without inspecting logs/events, the cause is hidden.

Simple explanation: A machine turns on and immediately breaks. Pressing the power button again just breaks it again. You need to open it and see why.

Technical Answer:

  1. kubectl logs <pod> — previous container logs (--previous) if it already restarted.
  2. kubectl describe pod <pod> — events, exit code, OOMKilled, image pull errors.
  3. kubectl get pod <pod> -o yaml — inspect container status, lastState, restartCount.
  4. Run a debug shell: kubectl run debug --image=busybox -i --tty --rm -- sh to test DNS/connectivity.
  5. Check liveness/readiness probes — an overly aggressive probe can kill healthy pods.

Code/Syntax Justification:

kubectl logs my-pod --previous # logs from crashed container
kubectl describe pod my-pod # events and exit codes
kubectl get pod my-pod -o jsonpath='{.status.containerStatuses[0].lastState}'
kubectl run debug --image=curlimages/curl -i --tty --rm -- sh

Workflow Diagram:

Pod CrashLoopBackOff
|
v
kubectl logs --previous --> app crash reason (stack trace, config error)
kubectl describe pod --> OOMKilled, ImagePullBackOff, failed probes
kubectl get pod -o yaml --> restartCount, lastState, termination reason
|
v
Fix root cause: configmap, secret, image tag, probe threshold, resource limits
|
v
Pod stabilizes (Running)

🔍 Behind the Question: Kubernetes debugging, pod lifecycle, exit codes, probes.

❌ The Red Flags: Only restarting pods; not reading previous logs; ignoring OOMKilled; no probe tuning.


Q32: Node under-provisioned — pods evicted due to resource pressure​

Level: Senior

Scenario: Worker nodes run out of memory. Kubernetes evicts pods to free memory. The evicted pods reschedule on other nodes, cascading pressure. The cluster becomes unstable.

Impact: Pod evictions. Service disruption. Cascading failures across nodes.

Root Cause: No resource requests/limits set. Kubernetes schedules pods without knowing actual needs. The node's allocatable memory is exhausted because pods consume more than expected.

Simple explanation: Ten people squeeze into a five-person car. Someone has to get out. Everyone tries to squeeze into other cars, overloading them too.

Technical Answer:

  1. Set requests (scheduling) and limits (hard cap) for CPU and memory on every container.
  2. Use LimitRange to enforce defaults per namespace.
  3. Right-size based on metrics (VPA recommendations, actual usage).
  4. Set node resource reservations (kubelet --kube-reserved) so system processes keep memory.
  5. Use cluster autoscaler to add nodes when pods are unschedulable.

Code/Syntax Justification:

resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "1000m"

Workflow Diagram:

No limits: With requests + limits:
Pods consume unbounded memory Kubelet knows pod needs
Node memory exhausted Node schedules only if memory available
kubelet evicts pods Container hitting limit -> OOM kill (single pod)
Cascading to other nodes Other nodes unaffected

🔍 Behind the Question: Resource requests/limits, node pressure, eviction, right-sizing.

❌ The Red Flags: No requests/limits on containers; relying on default unlimited; not right-sizing from metrics.


Q33: Slow deployment — rolling update causes brief downtime or failures​

Level: Principal

Scenario: A rolling update of a Deployment replaces pods one by one. During the update, old and new versions run simultaneously. The new version has a breaking database change. Requests to new pods fail while old pods still work. Users see intermittent errors.

Impact: Intermittent errors during deploy. Partial outage. Rollback complexity.

Root Cause: Non-backward-compatible code + schema change deployed together. New code expects new schema; old code expects old schema. During rolling update, both versions serve traffic.

Simple explanation: Replacing airplane engines mid-flight. The new engine needs different fuel than the old one. Passengers feel the mismatch.

Technical Answer:

  1. Backward-compatible changes only: add new columns (nullable), dual-write, deploy code that works with both old and new schema.
  2. Use feature flags to gate new behavior.
  3. Readiness probe must pass before a new pod receives traffic.
  4. Canary deploy: route 5% traffic to new version, monitor error rate, then promote.
  5. maxSurge and maxUnavailable tuned so enough old pods stay healthy during update.

Code/Syntax Justification:

strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 0 # never drop below 100% capacity during update
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 5

Workflow Diagram:

Rolling update
|
v
Old pods (v1) + New pods (v2) both serve traffic
|
+-- v2 backward-compatible --> smooth rollout
|
+-- v2 NOT backward-compatible --> intermittent errors
|
v
Fix: dual-write + feature flag + canary

🔍 Behind the Question: Rolling updates, backward compatibility, readiness probes, canary, maxSurge/maxUnavailable.

❌ The Red Flags: Breaking schema change + code deploy together; maxUnavailable: 100% (all pods down during update); no readiness probe.


Q34: Scheduling failure — pods Pending due to taints/tolerations or node affinity​

Level: Senior

Scenario: Pods remain Pending with message "0/3 nodes are available: 3 Insufficient memory, 3 node(s) had untolerated taint." The cluster has nodes but pods cannot schedule.

Impact: Workloads not running. Autoscaler may not trigger because taints block scheduling.

Root Cause: Node taints repel pods without matching tolerations. Node affinity/anti-affinity rules overly restrictive. Insufficient cluster capacity.

Simple explanation: A club has a dress code (taint). You're not wearing the right clothes (toleration), so the bouncer won't let you in, even though the club isn't full.

Technical Answer:

  1. Check kubectl describe pod for the exact scheduling failure reason.
  2. Add matching tolerations to the pod spec if the taint is intentional (e.g., GPU nodes).
  3. Remove overly restrictive node affinity/anti-affinity.
  4. Add nodes or right-size pods if it's a capacity issue.
  5. Use kubectl get nodes to check Allocatable vs Allocated resources.

Code/Syntax Justification:

tolerations:
- key: "nvidia.com/gpu"
operator: "Exists"
effect: "NoSchedule"

Workflow Diagram:

Pod Pending
|
v
kubectl describe pod
|
+-- "Insufficient memory" --> add nodes or reduce pod requests
|
+-- "untolerated taint" --> add toleration or remove taint
|
+-- node affinity mismatch --> relax affinity rules
|
v
Pod scheduled -> Running

🔍 Behind the Question: Taints/tolerations, node affinity, scheduling, cluster capacity.

❌ The Red Flags: Adding tolerations blindly without understanding the taint; ignoring capacity; not reading describe output.


Q35: Control plane vs data plane outage — diagnosing an EKS cluster issue​

Level: Principal

Scenario: kubectl get pods returns "Unable to connect to the server." Existing workloads keep running but no new deployments or changes are possible. The EKS control plane (API server) is unreachable.

Impact: Control plane outage — cannot manage cluster. Data plane (running pods) continues serving traffic.

Root Cause: EKS control plane issue (API server, etcd), VPC endpoint/security group blocking access to the EKS endpoint, IAM auth misconfiguration, or aws-auth ConfigMap corrupted.

Simple explanation: The building's front office (control plane) is locked. People already inside (pods) keep working, but nobody can enter or make changes.

Technical Answer:

  1. Verify kubectl config context and aws eks update-kubeconfig.
  2. Check EKS endpoint access: public vs private endpoint, security group allowing your CIDR on port 443.
  3. Verify IAM: your IAM user/role is mapped in aws-auth ConfigMap (eksctl get iamidentitymapping).
  4. Check VPC CNI, DNS (CorePods), and API server logs via CloudWatch.
  5. If private endpoint only, ensure you connect from within the VPC or via VPN/Direct Connect.

Code/Syntax Justification:

aws eks update-kubeconfig --region us-east-1 --name my-cluster
kubectl cluster-info
eksctl get iamidentitymapping --cluster my-cluster
kubectl get nodes # tests API server reachability

Workflow Diagram:

kubectl get pods -> "Unable to connect"
|
v
Check 1: kubeconfig context correct?
Check 2: EKS endpoint reachable (public/private + SG)?
Check 3: IAM identity mapping exists for user?
Check 4: CoreDNS / VPC CNI healthy?
|
v
Fix: update-kubeconfig, security group CIDR, aws-auth ConfigMap
|
v
kubectl works again

🔍 Behind the Question: EKS control plane vs data plane, IAM auth, endpoint access, troubleshooting hierarchy.

❌ The Red Flags: Assuming cluster is down when only control plane is unreachable; not checking IAM mapping; modifying aws-auth incorrectly.


Q36: etcd backup and restore for EKS​

Level: Principal

Scenario: EKS manages etcd (you do not access it directly). A bad kubectl delete or misconfigured controller corrupts cluster state. You need to recover. EKS does not expose etcd snapshots to you.

Impact: Potential cluster state loss. You cannot self-restore etcd because AWS owns the control plane.

Root Cause: Misconception that you manage etcd in EKS. Recovery relies on EKS AWS-side backups and rebuilding node groups, not etcdctl snapshot.

Simple explanation: You rent a storage unit (EKS control plane). The facility (AWS) backs it up. You cannot go inside and replace the boxes yourself.

Technical Answer:

  1. EKS control plane (including etcd) is managed by AWS — you do not back up/restore etcd directly.
  2. Protect against state loss by exporting critical resources (kubectl get all -A -o yaml, Helm releases, CRDs) to GitOps (ArgoCD/Flux).
  3. Use eksctl create cluster + GitOps to rebuild the cluster and re-sync desired state.
  4. For worker node data (ephemeral), use EBS-backed persistent volumes and EBS snapshots.
  5. Enable EKS add-on version management and automated patching.

Code/Syntax Justification:

# Export desired state for disaster recovery
kubectl get all,ingresses,networkpolicies,secrets,configmaps -A -o yaml > cluster-state.yaml
# Rebuild via GitOps (ArgoCD/Flux) re-syncs from Git

Workflow Diagram:

Disaster: cluster state corrupted
|
v
EKS etcd managed by AWS (not directly accessible)
|
v
Recovery path:
1. Provision new EKS cluster (eksctl / console)
2. GitOps (ArgoCD/Flux) re-applies desired state from Git
3. Worker nodes join, PVCs reattach via EBS snapshots
4. Cluster restored to desired state

🔍 Behind the Question: Managed control plane responsibility, GitOps disaster recovery, etcd ownership in EKS.

❌ The Red Flags: Trying to run etcdctl snapshot on EKS; no GitOps/export of cluster state; assuming EKS backs up application data (it doesn't).


Senior / Principal — Amazon EKS Real World Scenarios (Continued)​

Q37: Control plane endpoint access — public vs private​

Level: Senior

Scenario: An EKS cluster has a public API server endpoint. Security team flags it as a risk: anyone on the internet can reach the Kubernetes API. The team needs to restrict access while still allowing CI/CD and developer access from corporate IPs.

Impact: Unauthorized API access risk. Potential cluster compromise.

Root Cause: EKS control plane endpoint is publicly accessible with no source IP restrictions.

Simple explanation: The building's front door is unlocked. Anyone can walk in. You need a keycard or a guard to check IDs.

Technical Answer:

  1. Use private endpoint (control plane accessible only within VPC) or restrict public endpoint with publicAccessCidrs (allowlist corporate IPs).
  2. Use IAM authenticator (aws eks update-kubeconfig) for authentication — no static credentials.
  3. Use aws-auth ConfigMap to map IAM roles/users to Kubernetes RBAC (admin, view, edit).
  4. Use VPC endpoints (PrivateLink) for private control plane access from on-prem via VPN/Direct Connect.
  5. Combine with Kubernetes RBAC for fine-grained authorization (who can do what).

Code/Syntax Justification:

# aws-auth ConfigMap - map IAM role to k8s RBAC
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: arn:aws:iam::123456789012:role/eks-admin
username: admin
groups:
- system:masters
- rolearn: arn:aws:iam::123456789012:role/ci-cd-role
username: ci-cd
groups:
- system:masters

Workflow Diagram:

Public endpoint, no restrictions: Private endpoint + allowlist:
Anyone can reach API server Only VPC + allowed CIDRs
| |
v v
High compromise risk Reduced attack surface
| |
v v
Fix: publicAccessCidrs + IAM authenticator + aws-auth

🔍 Behind the Question: EKS endpoint access, public vs private, IAM authenticator, aws-auth, CIDR allowlisting.

❌ The Red Flags: Public endpoint with 0.0.0.0/0; static credentials; no RBAC; no CIDR restrictions.


Q38: IAM roles for service accounts (IRSA) — least privilege​

Level: Senior

Scenario: A pod needs to access S3. The team uses node-level IAM role (all pods on the node share the same role). A compromised pod can access all S3 buckets the node role can.

Impact: Over-privileged pods. Blast radius if compromised. Violates least privilege.

Root Cause: Node IAM role shared across all pods. No per-pod IAM differentiation.

Simple explanation: Everyone in the office has the master key. If one person's badge is stolen, the thief can open every door.

Technical Answer:

  1. Use IRSA (IAM Roles for Service Accounts): associate IAM role with Kubernetes service account.
  2. Pod uses the service account's IAM role via projected credentials (WebIdentity token).
  3. Each pod gets only the permissions it needs (least privilege).
  4. Remove broad node-level IAM role permissions where possible.
  5. Use eksctl create iamserviceaccount or Terraform to set up OIDC provider and trust policy.

Code/Syntax Justification:

# Service account with IRSA annotation
apiVersion: v1
kind: ServiceAccount
metadata:
name: s3-access-sa
namespace: default
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/s3-readonly-role

# Pod uses the service account
apiVersion: v1
kind: Pod
metadata:
name: s3-reader
spec:
serviceAccountName: s3-access-sa
containers:
- name: app
image: myapp

Workflow Diagram:

Node IAM role (shared): IRSA (per-pod):
All pods on node = same role Pod A = S3 read only
| |
v v
Compromised pod = full node access Compromised pod = limited S3 access

🔍 Behind the Question: IRSA, IAM Roles for Service Accounts, least privilege, OIDC provider, projected tokens.

❌ The Red Flags: Node-level IAM role for all pods; broad S3 permissions; no service account separation.


Q39: Pod security standards — restrictive vs baseline​

Level: Senior

Scenario: A pod runs as root with host network access. A security audit flags it: container breakout could compromise the host node.

Impact: Host compromise. Container escape. Lateral movement across cluster.

Root Cause: Pod runs with excessive privileges (root, hostNetwork, hostPID, privileged).

Simple explanation: A container is a isolated room. Running as root with host network is like leaving the room door open and giving the intruder keys to the building.

Technical Answer:

  1. Use Pod Security Standards (restricted, baseline, privileged) via namespace labels.
  2. restricted level: runAsNonRoot, readOnlyRootFilesystem, no hostNetwork/hostPID, no privileged.
  3. Use allowPrivilegeEscalation: false and capabilities: drop: ["ALL"].
  4. Use runAsUser: 1000 (non-root) and runAsGroup: 1000.
  5. Use seccompProfile: RuntimeDefault or Localhost.

Code/Syntax Justification:

# Namespace label for Pod Security Standard
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/enforce-version: latest

# Pod spec - restricted
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: app
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
readOnlyRootFilesystem: true

Workflow Diagram:

Privileged pod (root, hostNetwork): Restricted pod (non-root, no host):
Container breakout = host compromise Container breakout = contained
| |
v v
Full cluster at risk Blast radius limited to pod

🔍 Behind the Question: Pod Security Standards, runAsNonRoot, readOnlyRootFilesystem, seccomp, capabilities drop.

❌ The Red Flags: Running as root; privileged containers; hostNetwork/hostPID; no seccomp profile.


Q40: Pod Disruption Budget (PDB) — voluntary disruptions​

Level: Senior

Scenario: A cluster upgrade drains nodes. All replicas of a critical deployment are evicted simultaneously. The service has zero healthy pods during the upgrade. Users see errors.

Impact: Service downtime during maintenance. No availability guarantee.

Root Cause: No Pod Disruption Budget. Kubernetes allows all replicas to be evicted at once during voluntary disruptions (node drain, cluster upgrade).

Simple explanation: A restaurant fires all cooks at once to retrain them. No one can cook during retraining. Customers leave hungry.

Technical Answer:

  1. Set PDB with minAvailable (e.g., 2) or maxUnavailable (e.g., 1) for critical deployments.
  2. PDB prevents voluntary evictions that would drop healthy pods below the threshold.
  3. Node drains wait until enough healthy pods exist elsewhere.
  4. Combine with cluster autoscaler and rolling updates.
  5. Monitor PDB status (current healthy, desired healthy, disruptions allowed).

Code/Syntax Justification:

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
namespace: default
spec:
minAvailable: 2
selector:
matchLabels:
app: api

Workflow Diagram:

No PDB: With PDB (minAvailable: 2):
Drain node -> evict all replicas Drain node -> evict only if 2+ healthy remain
| |
v v
0 healthy pods during upgrade Wait for new pod healthy before next eviction
Service down Service stays available

🔍 Behind the Question: PDB, minAvailable/maxUnavailable, voluntary disruptions, node drains, availability.

❌ The Red Flags: No PDB for critical deployments; evicting all replicas at once; not monitoring PDB status.


Q41: Cluster autoscaler — pending pods and scale-up​

Level: Principal

Scenario: Pods are pending because no node has capacity. Cluster autoscaler should add nodes but doesn't. Pods stay pending for hours.

Impact: Workloads not running. Scaling doesn't happen. Service degraded.

Root Cause: Autoscaler not configured, wrong node group, or pods have unschedulable constraints (node affinity, taints, large resource requests).

Simple explanation: You need more tables at a restaurant. You call for more tables. They never arrive. Customers stand waiting.

Technical Answer:

  1. Verify cluster autoscaler is running and has IAM permissions for ASG.
  2. Check pod scheduling constraints (node affinity, taints/tolerations, resource requests too large for instance type).
  3. Ensure node group has min/max size configured and autoscaler tags.
  4. Use cluster-autoscaler.kubernetes.io/inuse annotation or node group labels.
  5. Monitor cluster_autoscaler_scale_up_events and pending pods.

Code/Syntax Justification:

# Cluster autoscaler tag on ASG
# Key: k8s.io/cluster-autoscaler/enabled, Value: ""
# Key: k8s.io/cluster-autoscaler/<cluster-name>, Value: ""

# Pod with large request that may not fit
resources:
requests:
memory: "100Gi" # too large for most instance types

Workflow Diagram:

Pending pods: Autoscaler working:
No node capacity Pending pods detected
| |
v v
Autoscaler not running Autoscaler evaluates ASG
| |
v v
Pods stay pending forever Add nodes -> pods schedule

🔍 Behind the Question: Cluster autoscaler, pending pods, scheduling constraints, ASG integration, scale-up events.

❌ The Red Flags: Autoscaler not installed; pods with requests larger than any instance type; taints blocking scheduling; no autoscaler tags on ASG.


Q42: Node groups — managed vs self-managed​

Level: Senior

Scenario: A team uses self-managed EC2 nodes for EKS. They spend time patching, upgrading, and managing node OS. They want to reduce operational overhead.

Impact: High operational toil. Node upgrades are manual and error-prone.

Root Cause: Self-managed nodes require the team to handle patching, upgrades, and drain/termination.

Simple explanation: You build and maintain your own servers. AWS managed nodes (EKS managed node groups) handle patching and upgrades for you.

Technical Answer:

  1. Use EKS Managed Node Groups: AWS handles node provisioning, patching, and upgrades.
  2. Use launch templates with managed node groups for customization (custom AMI, user data).
  3. Use eksctl or Terraform to manage node groups declaratively.
  4. Enable automatic node replacement on upgrade (drain old nodes before terminating).
  5. Consider AWS Fargate for serverless pods (no node management at all).

Code/Syntax Justification:

# eksctl managed node group
managedNodeGroups:
- name: linux-nodes
instanceType: m6i.large
desiredCapacity: 3
minSize: 1
maxSize: 10
volumeSize: 100
privateNetworking: true

Workflow Diagram:

Self-managed nodes: Managed node groups:
Team patches, upgrades, drains AWS handles patching/upgrades
| |
v v
High toil Lower toil, AWS manages node lifecycle

🔍 Behind the Question: Managed vs self-managed node groups, launch templates, node replacement, Fargate.

❌ The Red Flags: Self-managed nodes with high toil; manual node upgrades; no node replacement strategy; not considering Fargate for serverless workloads.


Q43: Add-ons — CoreDNS, VPC CNI, kube-proxy​

Level: Senior

Scenario: CoreDNS pods are CrashLoopBackOff. DNS resolution fails for in-cluster services. Applications can't reach each other by service name.

Impact: Service discovery broken. In-cluster communication fails.

Root Cause: CoreDNS add-on misconfigured, insufficient resources, or cluster DNS (clusterIP) issues.

Simple explanation: The phone directory (DNS) is broken. People can't look up phone numbers. Calls can't be made.

Technical Answer:

  1. CoreDNS is the EKS DNS add-on. Check CoreDNS pod logs and resource limits.
  2. Ensure CoreDNS has enough replicas (2+) and CPU/memory.
  3. Verify VPC CNI add-on is functioning (pod networking).
  4. Check kube-proxy add-on (service routing).
  5. Use EKS add-ons (managed) for CoreDNS, VPC CNI, kube-proxy for easier updates.

Code/Syntax Justification:

# CoreDNS deployment - ensure 2 replicas
apiVersion: apps/v1
kind: Deployment
metadata:
name: coredns
namespace: kube-system
spec:
replicas: 2
template:
spec:
containers:
- name: coredns
resources:
requests:
cpu: 100m
memory: 128Mi

Workflow Diagram:

CoreDNS CrashLoopBackOff: Healthy CoreDNS:
DNS resolution fails DNS resolves service names
| |
v v
Pods can't reach each other In-cluster communication works

🔍 Behind the Question: CoreDNS, VPC CNI, kube-proxy, EKS add-ons, DNS troubleshooting.

❌ The Red Flags: CoreDNS with 1 replica; no DNS troubleshooting; not using EKS managed add-ons; ignoring CNI issues.


Q44: Fargate profiles — serverless pods​

Level: Senior

Scenario: A team has bursty workloads (nightly batch jobs). They don't want to manage worker nodes that sit idle most of the time.

Impact: Paying for idle nodes. Over-provisioning for burst capacity.

Root Cause: Worker nodes run 24/7 even when no pods need them.

Simple explanation: You keep a restaurant open 24/7 even though only 2 customers come at 3 AM. You pay for staff and rent with no customers.

Technical Answer:

  1. Use EKS Fargate profiles: serverless pods, no node management, pay per pod vCPU/memory.
  2. Fargate profiles select pods by namespace/label selectors.
  3. Ideal for bursty, intermittent, or event-driven workloads.
  4. Limitations: no DaemonSets, no host networking, no GPU, limited instance types.
  5. Combine Fargate (bursty) with managed node groups (steady-state) for cost optimization.

Code/Syntax Justification:

# Fargate profile
fargateProfiles:
- name: fp-batch
selectors:
- namespace: batch-jobs
- namespace: default
labels:
workload: fargate

Workflow Diagram:

Steady-state nodes: Fargate for bursty:
Nodes run 24/7 No nodes to manage
| |
v v
Pay for idle capacity Pay per pod vCPU/memory
| |
v v
High cost for bursty workloads Scale to zero when idle

🔍 Behind the Question: Fargate profiles, serverless pods, cost optimization, bursty workloads, limitations.

❌ The Red Flags: Fargate for steady-state high-load (more expensive); DaemonSets on Fargate (not supported); not understanding Fargate limitations.


Q45: Add-on version management — keeping add-ons updated​

Level: Principal

Scenario: EKS add-ons (CoreDNS, kube-proxy, VPC CNI) are running old versions with known vulnerabilities. The team hasn't updated them. Security scan flags them.

Impact: Security vulnerabilities. Known exploits. Compliance issues.

Root Cause: Add-on versions not tracked or updated. No add-on version management process.

Simple explanation: You install apps on your phone but never update them. Security bugs from years ago are still present.

Technical Answer:

  1. Use EKS managed add-ons for easier version updates via console/CLI/Terraform.
  2. Check add-on version against EKS recommended versions.
  3. Test add-on upgrades in staging before production.
  4. Use eksctl update addon or AWS console to resolve version mismatches.
  5. Monitor security bulletins for Kubernetes components.

Code/Syntax Justification:

# Check add-on versions
eksctl get addon --cluster my-cluster --name coredns

# Update add-on
eksctl update addon --cluster my-cluster --name coredns --version latest

Workflow Diagram:

Old add-on versions: Updated add-ons:
Known vulnerabilities Current versions
| |
v v
Security scan flags issues Security scan passes
| |
v v
Fix: eksctl update addon Regular add-on version review

🔍 Behind the Question: Add-on version management, EKS managed add-ons, security patching, update process.

❌ The Red Flags: Never updating add-ons; not tracking recommended versions; no staging testing for add-on upgrades.


Q46: Network policy — pod-to-pod traffic control​

Level: Senior

Scenario: All pods can talk to all pods in the cluster. A compromised pod can scan and attack other pods. The team wants to restrict traffic to only necessary paths.

Impact: Lateral movement. Blast radius if one pod is compromised. Zero trust not implemented.

Root Cause: No NetworkPolicy. Default Kubernetes allows all pod-to-pod traffic.

Simple explanation: Everyone in the office can enter every room. You need keycards to restrict room access.

Technical Answer:

  1. Use NetworkPolicy to restrict ingress/egress at pod level (namespace-scoped).
  2. Default deny all, then allow specific traffic (namespace, pod selector, port).
  3. Combine with service mesh (Istio, Linkerd) for more granular mTLS and L7 policy.
  4. Test network policies in staging (easy to break application traffic).
  5. Monitor network policy hits/drops via VPC flow logs or CNI metrics.

Code/Syntax Justification:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: backend-policy
namespace: production
spec:
podSelector:
matchLabels:
app: backend
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
app: frontend
ports:
- protocol: TCP
port: 8080
egress:
- to:
- podSelector:
matchLabels:
app: database
ports:
- protocol: TCP
port: 5432

Workflow Diagram:

No network policy: With network policy:
All pods can talk to all pods Backend only accepts from frontend on 8080
| |
v v
Compromised pod attacks all pods Compromised pod can't reach unrelated pods

🔍 Behind the Question: NetworkPolicy, default deny, pod selector, service mesh, zero trust.

❌ The Red Flags: No network policies; allowing all ingress/egress; not testing policies before production.


Q47: Cluster upgrades — EKS version upgrade process​

Level: Principal

Scenario: An EKS cluster is on Kubernetes 1.28. AWS announces 1.28 end-of-life. The team needs to upgrade to 1.29 or 1.30. They're worried about breaking changes (deprecated APIs, add-on compatibility).

Impact: Security risk from EOL. Potential breakage during upgrade. No clear upgrade path.

Root Cause: No upgrade process. Not tracking Kubernetes version lifecycle. Add-on compatibility not verified.

Simple explanation: Your phone's OS is no longer supported. You need to upgrade before security patches stop. You must check your apps still work first.

Technical Answer:

  1. Upgrade control plane first (EKS manages this), then add-ons, then worker nodes.
  2. Check deprecated APIs in kube-deprecation-migration-guide or Polaris.
  3. Update add-ons (CoreDNS, VPC CNI, kube-proxy) to versions compatible with new K8s.
  4. Upgrade worker nodes (managed node groups or replace with new AMI).
  5. Test upgrade in staging cluster first. Use eksctl upgrade cluster.

Code/Syntax Justification:

# Upgrade EKS cluster control plane
eksctl upgrade cluster --name my-cluster --version 1.30

# Upgrade managed node group
eksctl upgrade nodegroup --cluster my-cluster --name linux-nodes --kubernetes-version 1.30

Workflow Diagram:

No upgrade process: Structured upgrade:
K8s version reaches EOL Control plane -> add-ons -> worker nodes
| |
v v
Security vulnerabilities Test in staging first
| |
v v
Production at risk Controlled upgrade with rollback plan

🔍 Behind the Question: EKS upgrade process, control plane first, deprecated APIs, add-on compatibility, staging testing.

❌ The Red Flags: Running EOL Kubernetes; upgrading everything at once; not checking deprecated APIs; no staging test.


Q48: Bottle Rocket / Bottlerocket OS — hardened EKS nodes​

Level: Principal

Scenario: A security team wants to reduce the attack surface of EKS worker nodes. Standard Amazon Linux 2 has many unnecessary packages and services.

Impact: Larger attack surface. More patches to manage. Higher security risk.

Root Cause: General-purpose OS with unnecessary packages running on worker nodes.

Simple explanation: You use a full desktop OS for a kiosk. It has games, browsers, and tools you don't need. More things to patch and attack.

Technical Answer:

  1. Use Bottle Rocket: purpose-built, minimal OS for Kubernetes (contains only what's needed to run containers).
  2. Bottle Rocket has minimal packages, read-only root filesystem, automatic updates via atomic swap.
  3. Use Bottle Rocket with EKS managed node groups.
  4. Reduced patching surface, faster boot, smaller attack surface.
  5. Trade-off: less flexibility for custom software on nodes (run custom software in pods instead).

Code/Syntax Justification:

# eksctl with Bottle Rocket
managedNodeGroups:
- name: bottlerocket-nodes
instanceType: m6i.large
amiFamily: Bottlerocket
desiredCapacity: 3

Workflow Diagram:

Standard Amazon Linux 2: Bottle Rocket:
Many packages, services Minimal, container-only
| |
v v
Large patching surface Small patching surface
More attack surface Hardened by design

🔍 Behind the Question: Bottle Rocket OS, hardened nodes, minimal attack surface, atomic updates.

❌ The Red Flags: General-purpose OS on worker nodes; running custom software on nodes instead of pods; not using Bottle Rocket for security-focused workloads.


Q49: Observability — Container Insights and VPC flow logs​

Level: Senior

Scenario: An EKS cluster has high latency. The team doesn't know if it's network, application, or infrastructure. No unified observability.

Impact: Slow mean time to diagnose (MTTD). Finger-pointing between teams.

Root Cause: No unified observability. Metrics, logs, and traces in separate silos.

Simple explanation: A car makes a noise. The mechanic checks only the engine. It could be the brakes, tires, or transmission. You need to check all systems.

Technical Answer:

  1. Enable Container Insights (CloudWatch) for cluster, node, pod, and container metrics.
  2. Use VPC flow logs for network-level visibility (accepted/rejected traffic).
  3. Use CloudWatch Container Insights for K8s-specific metrics (CPU, memory, network, storage per pod).
  4. Add distributed tracing (X-Ray, OpenTelemetry) for application-level latency.
  5. Correlate metrics, logs, and traces in a unified dashboard (Grafana, CloudWatch dashboards).

Code/Syntax Justification:

# Enable Container Insights
# Via eksctl or CloudWatch agent config
# Cluster name, region, and log group needed

Workflow Diagram:

No observability: Unified observability:
"Slow cluster" - don't know why Container Insights (pod/node metrics)
| |
v v
Finger-pointing VPC flow logs (network)
X-Ray (traces)
Correlated dashboard
Fast root cause

🔍 Behind the Question: Container Insights, VPC flow logs, observability, MTTD, metrics/logs/traces correlation.

❌ The Red Flags: No cluster monitoring; metrics in silos; no network visibility; no tracing.


Q50: EKS cost optimization — right-sizing and Spot​

Level: Principal

Scenario: EKS cluster runs on On-Demand m6i.large nodes 24/7. Workloads are bursty (dev/test during day, batch at night). Cost is high.

Impact: Unnecessary compute cost. Over-provisioning for peak.

Root Cause: Using On-Demand instances for all workloads. No Spot usage. No right-sizing.

Simple explanation: You book a hotel room for 30 nights but only stay 10. You pay for empty nights.

Technical Answer:

  1. Use Spot instances for fault-tolerant workloads (batch, CI/CD, stateless services) — up to 90% savings.
  2. Use Spot Fleet with diversification across instance types and AZs.
  3. Right-size instances based on actual usage (CloudWatch, VPA recommendations).
  4. Use cluster autoscaler to scale to zero or near-zero during off-hours.
  5. Use Savings Plans or Reserved Instances for steady-state baseline.

Code/Syntax Justification:

# Spot diversification in managed node group
managedNodeGroups:
- name: spot-nodes
instanceTypes: ["m6i.large", "m5.large", "c5.large"] # diversify
spot: true
desiredCapacity: 3

Workflow Diagram:

All On-Demand: Spot + right-sizing:
Pay full price 24/7 Spot for fault-tolerant workloads
| |
v v
High cost Up to 90% savings on Spot
No optimization Right-sized instances

🔍 Behind the Question: Spot instances, right-sizing, Savings Plans, cluster autoscaler, cost optimization.

❌ The Red Flags: All On-Demand instances; no Spot for fault-tolerant workloads; over-provisioned instances; no cost monitoring.


Senior / Principal — Amazon EKS Real World Scenarios (Continued)​

Q51: IRSA — IAM Roles for Service Accounts​

Level: Senior

Scenario: A pod needs to access S3. The team uses the node-level IAM role shared by all pods on the node. A compromised pod can access all S3 buckets the node role can.

Impact: Over-privileged pods. Blast radius if compromised. Violates least privilege.

Root Cause: Node IAM role shared across all pods. No per-pod IAM differentiation.

Simple explanation: Everyone in the office has the master key. If one person's badge is stolen, the thief can open every door.

Technical Answer:

  1. Use IRSA (IAM Roles for Service Accounts): associate IAM role with Kubernetes service account.
  2. Pod uses the service account's IAM role via projected credentials (WebIdentity token).
  3. Each pod gets only the permissions it needs (least privilege).
  4. Remove broad node-level IAM role permissions where possible.
  5. Use eksctl create iamserviceaccount or Terraform to set up OIDC provider and trust policy.

Code/Syntax Justification:

# Service account with IRSA annotation
apiVersion: v1
kind: ServiceAccount
metadata:
name: s3-access-sa
namespace: default
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/s3-readonly-role

# Pod uses the service account
apiVersion: v1
kind: Pod
metadata:
name: s3-reader
spec:
serviceAccountName: s3-access-sa
containers:
- name: app
image: myapp

Workflow Diagram:

Node IAM role (shared): IRSA (per-pod):
All pods on node = same role Pod A = S3 read only
| |
v v
Compromised pod = full node access Compromised pod = limited S3 access

🔍 Behind the Question: IRSA, IAM Roles for Service Accounts, least privilege, OIDC provider, projected tokens.

❌ The Red Flags: Node-level IAM role for all pods; broad S3 permissions; no service account separation.


Q52: EKS cluster provisioning from blank AWS account​

Level: Principal

Scenario: You're given a completely blank AWS account and asked to walk through getting to a running EKS cluster with Argo CD on it. The interviewer wants your actual thought process, not just "install eksctl."

Impact: Tests end-to-end understanding of EKS cluster provisioning, IAM, VPC, networking, and GitOps.

Root Cause: Many candidates know kubectl but don't understand how to build an EKS cluster from scratch.

Simple explanation: You can't just "install kubectl" — you need VPC, subnets, IAM roles, CNI, control plane, worker nodes, kubeconfig, and then Argo CD on top.

Technical Answer:

  1. Account baseline: IAM roles, OIDC provider for IRSA.
  2. VPC and subnets: public/private subnets across AZs.
  3. EKS cluster: control plane, VPC CNI, node groups (managed or self-managed).
  4. kubeconfig: aws eks update-kubeconfig, IAM identity mapping (aws-auth ConfigMap).
  5. Argo CD: install via Helm/helm chart, connect to Git repo, configure app-of-apps pattern.
  6. Networking focus: CNI options, security groups, pod-to-pod communication.

Code/Syntax Justification:

# 1. Create EKS cluster
eksctl create cluster --name my-cluster --region us-east-1 --nodegroup-name linux-nodes --node-type m6i.large --nodes 3

# 2. Update kubeconfig
aws eks update-kubeconfig --region us-east-1 --name my-cluster

# 3. Install Argo CD
helm install argocd argo/argo-cd --namespace argocd --create-namespace

# 4. Create App-of-Apps
kubectl apply -f app-of-apps.yaml

Workflow Diagram:

Blank AWS Account:
|
v
IAM + OIDC provider
|
v
VPC + subnets (public/private, multi-AZ)
|
v
EKS control plane + node groups
|
v
aws eks update-kubeconfig + aws-auth ConfigMap
|
v
Argo CD (Helm) + Git repo connection
|
v
App-of-Apps pattern → GitOps delivery

🔍 Behind the Question: EKS provisioning, IAM, VPC, CNI, Argo CD, GitOps, end-to-end cluster lifecycle.

❌ The Red Flags: Only knowing eksctl create cluster; not understanding IAM/IRSA; not understanding CNI; not knowing GitOps/Argo CD.


Q53: EKS CNI and networking choices​

Level: Senior

Scenario: A team is deploying EKS and needs to choose a CNI plugin. They're deciding between AWS VPC CNI, Calico, Cilium, and kube-router. They need to understand trade-offs for network policy, performance, and IP address consumption.

Impact: Wrong CNI choice leads to IP exhaustion, poor performance, or limited network policy capabilities.

Root Cause: Not understanding the trade-offs between CNI options for EKS.

Simple explanation: You need to connect houses (pods) to roads (network). Different road types (CNIs) have different costs, speeds, and capacities.

Technical Answer:

  1. AWS VPC CNI: default, uses ENIs, simple, but each pod gets its own ENI (IP consumption concern).
  2. Calico: rich network policy, IP-in-IP or VXLAN overlay, good for multi-cluster.
  3. Cilium: eBPF-based, advanced load balancing, network policy, observability (Hubble).
  4. kube-router: simple, combines kube-proxy, CNI, and network policy.
  5. Consider IP address consumption (ENI limits), network policy needs, observability requirements.

Code/Syntax Justification:

# Calico network policy example
apiVersion: projectcalico.org/v3
kind: NetworkPolicy
metadata:
name: backend-policy
spec:
selector: app == "backend"
ingress:
- from:
- selector: app == "frontend"
ports:
- port: 8080
protocol: TCP

Workflow Diagram:

VPC CNI: Calico: Cilium:
ENI per pod IP-in-IP overlay eBPF-based
| | |
v v v
Simple, AWS-native Rich network policy Advanced LB + Hubble
IP consumption concern Good for multi-cluster eBPF observability

🔍 Behind the Question: CNI options, IP address consumption, network policy, eBPF, observability.

❌ The Red Flags: Not understanding IP consumption with VPC CNI; not knowing CNI trade-offs; no network policy strategy.


Q54: Supply chain security for container images​

Level: Principal

Scenario: A team builds container images and deploys them to EKS. They want to ensure image integrity from build to deployment. They're concerned about supply chain attacks.

Impact: Compromised images. Supply chain attacks. Untrusted code in production.

Root Cause: No image signing, no SBOM, no vulnerability scanning in the build pipeline.

Simple explanation: You receive a package but don't know where it came from or what's inside. You should verify the seal and contents.

Technical Answer:

  1. Image signing: sign images with cosign or Notary, verify at deployment time.
  2. SBOM (Software Bill of Materials): generate SBOM for each image, track dependencies.
  3. Vulnerability scanning: Trivy, Snyk, or Clair in CI pipeline.
  4. Admission controller: OPA Gatekeeper or Kyverno to block unsigned images.
  5. Image immutability: use digest references (sha256:) instead of mutable tags.

Code/Syntax Justification:

# Kyverno policy to require signed images
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-image-signature
spec:
rules:
- name: require-signed-image
match:
resources:
kinds: [Pod]
preconditions:
- key: "{{ request.object.spec.imagePullPolicy[0] }}"
operator: NotIn
value: ["Never"]
validate:
message: "Image must be signed"
pattern:
spec:
containers:
- name: "*"
image: "signed-registry.io/*@sha256:*"

Workflow Diagram:

Build pipeline: Supply chain security:
Build image → push Build → scan → sign → SBOM → deploy
| |
v v
Deploy unsigned image Verify signature → deploy only if signed

🔍 Behind the Question: Image signing, SBOM, vulnerability scanning, OPA Gatekeeper, Kyverno, image immutability.

❌ The Red Flags: No image signing; mutable tags; no SBOM; no vulnerability scanning in CI.


Q55: Runtime security — OPA Gatekeeper vs Kyverno vs Pod Security Standards​

Level: Senior

Scenario: A team wants to enforce runtime security policies on their EKS cluster. They're deciding between OPA Gatekeeper, Kyverno, and Pod Security Standards (PSS).

Impact: Wrong choice leads to complex policies, poor performance, or inadequate security.

Root Cause: Not understanding the differences between admission controllers and Pod Security Standards.

Simple explanation: You need security guards at the club entrance. OPA Gatekeeper is like a custom rule engine, Kyverno is like Kubernetes-native rules, PSS is like built-in venue rules.

Technical Answer:

  1. Pod Security Standards (PSS): built-in Kubernetes, three levels (baseline, restricted, privileged), namespace-level labels.
  2. OPA Gatekeeper: Rego-based policy engine, flexible but complex, good for complex multi-rule policies.
  3. Kyverno: Kubernetes-native, uses YAML (not Rego), easier for Kubernetes teams, supports mutation and validation.
  4. Choose PSS for baseline security, Kyverno for Kubernetes-native mutation/validation, OPA Gatekeeper for complex cross-resource policies.
  5. Can combine PSS (baseline) with Kyverno/OPA (advanced policies).

Code/Syntax Justification:

# Pod Security Standard namespace label
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/enforce-version: latest
pod-security.kubernetes.io/warn: latest
pod-security.kubernetes.io/audit: latest

Workflow Diagram:

PSS: Kyverno: OPA Gatekeeper:
Built-in K8s YAML-based, K8s-native Rego-based, flexible
| | |
v v v
Baseline (baseline/restricted) Mutation + validation Complex multi-rule policies
Namespace-level Easy for K8s teams Steeper learning curve

🔍 Behind the Question: PSS, OPA Gatekeeper, Kyverno, admission controllers, runtime security.

❌ The Red Flags: Not knowing PSS levels; using OPA Gatekeeper for simple policies; not combining PSS with admission controllers.


Q56: Defense in depth for EKS security​

Level: Principal

Scenario: A team wants to implement defense in depth for their EKS cluster. They have network policies, but they want a layered security approach.

Impact: Single point of failure. If one layer is breached, attacker has full access.

Root Cause: Relying on a single security layer (e.g., only network policies or only RBAC).

Simple explanation: You have one lock on your front door. If someone picks it, they're inside. You should have locks on doors, windows, and an alarm system.

Technical Answer:

  1. Network layer: Network policies, security groups, VPC isolation.
  2. Pod layer: Pod Security Standards, runtime security (Falco), read-only root filesystems.
  3. Identity layer: IRSA, RBAC, least privilege service accounts.
  4. Supply chain: image signing, SBOM, vulnerability scanning.
  5. Runtime monitoring: Falco for runtime threat detection, audit logging.
  6. Secrets: Kubernetes Secrets with encryption at rest, or external secrets manager (AWS Secrets Manager, HashiCorp Vault).

Code/Syntax Justification:

# Falco rule for detecting sensitive mount
- rule: Sensitive mount detected
desc: Detect when a sensitive host path is mounted
condition: evt.type = mount and evt.arg.target contains /var/run/docker.sock
output: Sensitive mount detected (user=%user.name container=%container.name)
priority: WARNING
tags: [container, mitre_privilege_escalation]

Workflow Diagram:

Defense in depth layers:
Network layer: Network policies, security groups, VPC isolation
Pod layer: Pod Security Standards, read-only root FS, Falco
Identity layer: IRSA, RBAC, least privilege service accounts
Supply chain: Image signing, SBOM, vulnerability scanning
Secrets: Encrypted secrets, external secrets manager
Runtime: Falco, audit logging, anomaly detection

🔍 Behind the Question: Defense in depth, layered security, PSS, IRSA, RBAC, Falco, supply chain security.

❌ The Red Flags: Relying on single security layer; no runtime security; no supply chain security; no secrets encryption.


Q57: EKS add-on version management​

Level: Senior

Scenario: EKS add-ons (CoreDNS, kube-proxy, VPC CNI) are running old versions with known vulnerabilities. The team hasn't updated them.

Impact: Security vulnerabilities. Known exploits. Compliance issues.

Root Cause: Add-on versions not tracked or updated. No add-on version management process.

Simple explanation: You install apps on your phone but never update them. Security bugs from years ago are still present.

Technical Answer:

  1. Use EKS managed add-ons for easier version updates via console/CLI/Terraform.
  2. Check add-on version against EKS recommended versions.
  3. Test add-on upgrades in staging before production.
  4. Use eksctl update addon or AWS console to resolve version mismatches.
  5. Monitor security bulletins for Kubernetes components.

Code/Syntax Justification:

# Check add-on versions
eksctl get addon --cluster my-cluster --name coredns

# Update add-on
eksctl update addon --cluster my-cluster --name coredns --version latest

Workflow Diagram:

Old add-on versions: Updated add-ons:
Known vulnerabilities Current versions
| |
v v
Security scan flags issues Security scan passes
| |
v v
Fix: eksctl update addon Regular add-on version review

🔍 Behind the Question: Add-on version management, EKS managed add-ons, security patching, update process.

❌ The Red Flags: Never updating add-ons; not tracking recommended versions; no staging testing for add-on upgrades.


Q58: EKS cluster upgrades — control plane first​

Level: Principal

Scenario: An EKS cluster is on Kubernetes 1.28. AWS announces 1.28 end-of-life. The team needs to upgrade to 1.29 or 1.30. They're worried about breaking changes (deprecated APIs, add-on compatibility).

Impact: Security risk from EOL. Potential breakage during upgrade. No clear upgrade path.

Root Cause: No upgrade process. Not tracking Kubernetes version lifecycle. Add-on compatibility not verified.

Simple explanation: Your phone's OS is no longer supported. You need to upgrade before security patches stop. You must check your apps still work first.

Technical Answer:

  1. Upgrade control plane first (EKS manages this), then add-ons, then worker nodes.
  2. Check deprecated APIs in kube-deprecation-migration-guide or Polaris.
  3. Update add-ons (CoreDNS, VPC CNI, kube-proxy) to versions compatible with new K8s.
  4. Upgrade worker nodes (managed node groups or replace with new AMI).
  5. Test upgrade in staging cluster first. Use eksctl upgrade cluster.

Code/Syntax Justification:

# Upgrade EKS cluster control plane
eksctl upgrade cluster --name my-cluster --version 1.30

# Upgrade managed node group
eksctl upgrade nodegroup --cluster my-cluster --name linux-nodes --kubernetes-version 1.30

Workflow Diagram:

No upgrade process: Structured upgrade:
K8s version reaches EOL Control plane -> add-ons -> worker nodes
| |
v v
Security vulnerabilities Test in staging first
| |
v v
Production at risk Controlled upgrade with rollback plan

🔍 Behind the Question: EKS upgrade process, control plane first, deprecated APIs, add-on compatibility, staging testing.

❌ The Red Flags: Running EOL Kubernetes; upgrading everything at once; not checking deprecated APIs; no staging test.


Q59: Bottle Rocket OS — hardened EKS nodes​

Level: Principal

Scenario: A security team wants to reduce the attack surface of EKS worker nodes. Standard Amazon Linux 2 has many unnecessary packages and services.

Impact: Larger attack surface. More patches to manage. Higher security risk.

Root Cause: General-purpose OS with unnecessary packages running on worker nodes.

Simple explanation: You use a full desktop OS for a kiosk. It has games, browsers, and tools you don't need. More things to patch and attack.

Technical Answer:

  1. Use Bottle Rocket: purpose-built, minimal OS for Kubernetes (contains only what's needed to run containers).
  2. Bottle Rocket has minimal packages, read-only root filesystem, automatic updates via atomic swap.
  3. Use Bottle Rocket with EKS managed node groups.
  4. Reduced patching surface, faster boot, smaller attack surface.
  5. Trade-off: less flexibility for custom software on nodes (run custom software in pods instead).

Code/Syntax Justification:

# eksctl with Bottle Rocket
managedNodeGroups:
- name: bottlerocket-nodes
instanceType: m6i.large
amiFamily: Bottlerocket
desiredCapacity: 3

Workflow Diagram:

Standard Amazon Linux 2: Bottle Rocket:
Many packages, services Minimal, container-only
| |
v v
Large patching surface Small patching surface
More attack surface Hardened by design

🔍 Behind the Question: Bottle Rocket OS, hardened nodes, minimal attack surface, atomic updates.

❌ The Red Flags: General-purpose OS on worker nodes; running custom software on nodes instead of pods; not using Bottle Rocket for security-focused workloads.


Q60: EKS observability — Container Insights and VPC flow logs​

Level: Senior

Scenario: An EKS cluster has high latency. The team doesn't know if it's network, application, or infrastructure. No unified observability.

Impact: Slow mean time to diagnose (MTTD). Finger-pointing between teams.

Root Cause: No unified observability. Metrics, logs, and traces in separate silos.

Simple explanation: A car makes a noise. The mechanic checks only the engine. It could be the brakes, tires, or transmission. You need to check all systems.

Technical Answer:

  1. Enable Container Insights (CloudWatch) for cluster, node, pod, and container metrics.
  2. Use VPC flow logs for network-level visibility (accepted/rejected traffic).
  3. Use CloudWatch Container Insights for K8s-specific metrics (CPU, memory, network, storage per pod).
  4. Add distributed tracing (X-Ray, OpenTelemetry) for application-level latency.
  5. Correlate metrics, logs, and traces in a unified dashboard (Grafana, CloudWatch dashboards).

Code/Syntax Justification:

# Enable Container Insights
# Via eksctl or CloudWatch agent config
# Cluster name, region, and log group needed

Workflow Diagram:

No observability: Unified observability:
"Slow cluster" - don't know why Container Insights (pod/node metrics)
| |
v v
Finger-pointing VPC flow logs (network)
X-Ray (traces)
Correlated dashboard
Fast root cause

🔍 Behind the Question: Container Insights, VPC flow logs, observability, MTTDR, metrics/logs/traces correlation.

❌ The Red Flags: No cluster monitoring; metrics in silos; no network visibility; no tracing.