Learn Kubernetes core architecture, production scenario-based questions, incident response, and real-world engineering solutions.
β Q1: Can you explain how the Kubernetes Scheduler works under the hood? How does it choose the best node for a pod?
Click on the dropdown below to reveal the technical answer.
Answer: The kube-scheduler is a control plane component that assigns unscheduled pods to nodes in a two-phase process:
β Q2: What is etcd, why is it critical to a Kubernetes cluster, and how does it maintain consistency?
Click on the dropdown below to reveal the technical answer.
Answer: etcd is a distributed, consistent, highly-available key-value store used as the backing database for all Kubernetes cluster data (configuration states, active nodes, pod statuses, secrets, endpoints).
kube-apiserver communicates directly with etcd; all other components update their state via the API server.β Q3: What is the role of kube-proxy in a cluster? Can you compare IPTables mode versus IPVS mode?
Click on the dropdown below to reveal the technical answer.
Answer: kube-proxy is a network daemon running on every node that implements the Kubernetes Service abstraction. It manages network routing, port forwarding, and service load-balancing:
β Q4: How does CoreDNS facilitate service discovery inside a Kubernetes cluster?
Click on the dropdown below to reveal the technical answer.
Answer:
CoreDNS is a flexible, extensible DNS server that runs as a deployment in the cluster, handling name resolution and service discovery.
Every service created in the cluster is assigned a DNS name (e.g., <service-name>.<namespace>.svc.cluster.local). CoreDNS translates these names to the matching service ClusterIP. Pods are configured to point their DNS resolver (/etc/resolv.conf) to the CoreDNS service IP.
β Q5: What are the primary responsibilities of the Kubernetes API Server (kube-apiserver)?
Click on the dropdown below to reveal the technical answer.
Answer: The kube-apiserver is the central management gateway of the control plane. It exposes the Kubernetes API over HTTP/HTTPS, serving as the entry point for all administrative, user, and controller modifications:
β Q5a: What is a CNI plugin, and what actually happens when a pod is assigned an IP?
Click on the dropdown below to reveal the technical answer.
Answer: A CNI (Container Network Interface) plugin is responsible for Pod networking in Kubernetes. When a Pod is created, the CNI plugin assigns it an IP address, creates its network interface, and connects it to the cluster network. It also configures routing so that Pods can communicate with other Pods and Services across the cluster. Common CNI plugins include Calico, Flannel, and Cilium.
β Q5b: If you had to choose a CNI, how would you compare Calico, Cilium, Flannel, and Weave?
Click on the dropdown below to reveal the technical answer.
Answer: For most production environments, I would choose Calico because it provides reliable networking, strong network policy support, and proven scalability. If advanced observability, security, and eBPF-based networking are important, I would consider Cilium. For simple labs or learning environments, Flannel is often the easiest choice.
β Q5c: What is eBPF, and why is the Cilium CNI moving away from standard iptables in favor of it?
Click on the dropdown below to reveal the technical answer.
Answer: eBPF (Extended Berkeley Packet Filter) is a Linux kernel technology that allows programs to run directly inside the Linux kernel without modifying the kernel source code.
β Q5d: Walk me through the Kubernetes networking model. How do pods communicate with each other?
Click on the dropdown below to reveal the technical answer.
Answer: Kubernetes networking is based on the principle that every Pod gets a unique IP and can communicate directly with any other Pod in the cluster. The CNI plugin provides networking and routing, kube-proxy enables Service communication, and CoreDNS handles service discovery.
β Q5e: Explain how Service IP routing works under the hood. How does a virtual IP reach a real pod?
Click on the dropdown below to reveal the technical answer.
Answer: A Kubernetes Service IP is a virtual IP that represents a set of backend Pods. kube-proxy watches Services and their endpoints and creates routing rules on each node. When traffic is sent to the Service IP, kube-proxy intercepts it, selects one of the backend Pods, rewrites the destination address, and forwards the packet to the chosen Pod. Depending on the mode, this is implemented using iptables, IPVS, or eBPF.
β Q5f: What is the difference between the legacy Ingress resource and the new Gateway API?
Click on the dropdown below to reveal the technical answer.
Answer: Ingress is the older Kubernetes resource for exposing HTTP/HTTPS services. Gateway API is its modern successor, offering better flexibility, advanced traffic routing, cleaner separation of responsibilities, and standardized configuration across different implementations.
β Q5g: How does NGINX Ingress Controller process incoming traffic and apply routing changes?
Click on the dropdown below to reveal the technical answer.
Answer: NGINX Ingress Controller watches Ingress resources and converts them into NGINX configuration. When traffic arrives, NGINX applies the configured host and path rules, forwards requests to the correct Service, and Kubernetes routes the traffic to the backend Pods.
β Q5h: What is an IngressClass and why would we run multiple ingress controllers?
Click on the dropdown below to reveal the technical answer.
Answer: IngressClass tells Kubernetes which Ingress Controller should manage a specific Ingress. Multiple ingress controllers are commonly used to separate internal and external traffic, support different environments, or provide different networking features.
β Q5i: If a user receives a 503 Service Unavailable, how would you troubleshoot the Ingress pathway?
Click on the dropdown below to reveal the technical answer.
Answer: When troubleshooting a 503 from an Ingress, I would follow the request path: Ingress β Service β Endpoints β Pods. First, I'd verify the Ingress configuration and ensure the Ingress Controller is healthy. Then I'd check that the backend Service exists and has valid Endpoints. Next, I'd confirm the Pods are running, ready, and correctly matched by the Service selectors. I'd also review Ingress Controller logs and test the Service directly to isolate whether the issue is in the Ingress layer or the application layer.
β Q5j: What is a CSI Driver, and why did Kubernetes migrate away from in-tree storage plugins?
Click on the dropdown below to reveal the technical answer.
Answer: CSI is the standard storage interface in Kubernetes. It allows Kubernetes to communicate with external storage systems and manage volumes for Pods. Kubernetes moved away from in-tree plugins to CSI because CSI is easier to maintain, more flexible, and allows storage vendors to update their drivers independently of Kubernetes.
β Q5k: How do you explain the relationships between PersistentVolumes (PV), PersistentVolumeClaims (PVC), and StorageClasses?
Click on the dropdown below to reveal the technical answer.
Answer: A PersistentVolume (PV) is the actual storage resource available in the cluster. A PersistentVolumeClaim (PVC) is a request for storage made by an application or Pod. A StorageClass defines how storage should be dynamically provisioned, such as the storage type and provisioner. When a PVC is created, Kubernetes either binds it to an existing PV or uses the StorageClass to dynamically create a new PV and bind it to the claim.
β Q5l: How does dynamic storage provisioning work when a developer deploys a PVC?
Click on the dropdown below to reveal the technical answer.
Answer: In dynamic provisioning, a developer creates a PVC, Kubernetes uses the StorageClass and CSI driver to automatically create the required storage volume, generates a PV, binds it to the PVC, and then mounts it to the Pod.
β Q5m: If our database needs more disk space, how do you expand an active PVC?
Click on the dropdown below to reveal the technical answer.
Answer: I would edit the PVC and increase the requested storage size. If the StorageClass supports volume expansion, Kubernetes and the CSI driver will automatically expand the underlying volume and filesystem.
β Q5n: What is IAM Roles for Service Accounts (IRSA), and how does it secure pod access to AWS?
Click on the dropdown below to reveal the technical answer.
Answer: STS (Security Token Service) is an AWS service that provides temporary security credentials. In IRSA, a Kubernetes Pod uses its Service Account to assume an IAM Role, and AWS STS issues temporary credentials that allow the Pod to securely access AWS services without storing long-term access keys.
β Q5o: How does authentication and authorization work in an Amazon EKS cluster? How does AWS IAM map to Kubernetes RBAC?
Click on the dropdown below to reveal the technical answer.
Answer: EKS uses AWS IAM for authentication and Kubernetes RBAC for authorization. IAM verifies the user's identity, and that identity is mapped to Kubernetes users or groups. RBAC policies then determine which Kubernetes resources and actions are allowed.
β Q5p: What is the AWS Load Balancer Controller, and how does it integrate Services and Ingresses with AWS ALB/NLB?
Click on the dropdown below to reveal the technical answer.
Answer: AWS Load Balancer Controller is a Kubernetes controller that automatically creates and manages AWS Load Balancers. It acts as a bridge between Kubernetes and AWS. When we create an Ingress, it creates an ALB (Application Load Balancer). When we create a Service of type LoadBalancer, it creates an NLB (Network Load Balancer). This removes the need to manually create and manage load balancers in AWS.
β Q5q: How do you upgrade an AWS EKS cluster in production with zero downtime?
Click on the dropdown below to reveal the technical answer.
Answer: For a production EKS upgrade, I would first review version compatibility and upgrade the EKS control plane. Next, I would upgrade cluster add-ons such as CoreDNS, kube-proxy, the VPC CNI, and CSI drivers. Then I would perform a rolling upgrade of worker nodes using Managed Node Groups or node draining. To ensure zero downtime, applications should have multiple replicas, readiness probes, and PodDisruptionBudgets configured so traffic continues flowing while nodes are being replaced. Finally, I would validate cluster health and application functionality after the upgrade.
β Q6: What is the operational difference between a Deployment and a StatefulSet? When would you use one over the other?
Click on the dropdown below to reveal the technical answer.
Answer:
web-7f8d9b), and share no unique identity or storage volumes.db-0, db-1, db-2).volumeClaimTemplates to attach a unique Persistent Volume (PV) to each pod index.β Q7: What is a DaemonSet, and can you share a few real-world examples of when you would deploy one?
Click on the dropdown below to reveal the technical answer.
Answer: A DaemonSet guarantees that a copy of a specific pod runs on all (or selected) nodes in the cluster. As nodes are added to the cluster, the DaemonSet scheduler automatically provisions matching pods on them.
node-exporter or Datadog agents reporting node metrics.kube-proxy or Calico CNI daemons.β Q8: How does a Kubernetes Job differ from a CronJob? When is each appropriate?
Click on the dropdown below to reveal the technical answer.
Answer:
0 2 * * * for daily at 2 AM). Useful for backups, database cleanup, or generating reports.β Q9: What is a ReplicaSet, and why do we rarely manage ReplicaSets directly in production?
Click on the dropdown below to reveal the technical answer.
Answer: A ReplicaSet is a controller that ensures a specified number of identical pod replicas are running at any given time. It uses a pod selector to identify active pods and spins up or terminates replicas to match the desired count. Note: Deployments manage ReplicaSets under the hood, handling rolling updates and version history automatically.
β Q10: What are Init Containers, and how do they differ from standard sidecars in a Pod's lifecycle?
Click on the dropdown below to reveal the technical answer.
Answer: Init Containers are specialized containers that run and complete before the main application containers start in a pod.
β Q11: How does Node Affinity work? What is the difference between required (hard) and preferred (soft) scheduling rules?
Click on the dropdown below to reveal the technical answer.
Answer: Node Affinity is a set of scheduling rules that constrains which nodes a pod can be scheduled on based on node labels.
requiredDuringSchedulingIgnoredDuringExecution (Hard requirement): The scheduler will not place the pod unless the node meets the label criteria.preferredDuringSchedulingIgnoredDuringExecution (Soft requirement): The scheduler tries to find a node matching the criteria; if none exist, it schedules the pod on another node anyway.β Q12: Can you explain the difference between Pod Affinity and Pod Anti-Affinity? Give me a scenario where you would use each.
Click on the dropdown below to reveal the technical answer.
Answer: Allows scheduling pods relative to other pods already running on nodes, based on labels:
β Q13: What are Taints and Tolerations? How do they work together to control pod placements?
Click on the dropdown below to reveal the technical answer.
Answer: Used to ensure pods are not scheduled on inappropriate nodes:
kubectl taint nodes node1 GPU=true:NoSchedule).GPU=true taint).
Taints repel pods, while tolerations allow pods to bypass the taints.β Q14: What is a Pod Disruption Budget (PDB), and how does it protect active workloads during maintenance?
Click on the dropdown below to reveal the technical answer.
Answer: A Pod Disruption Budget (PDB) defines the minimum number of replicas (or maximum unavailable replicas) that must remain healthy during voluntary disruptions (e.g., node draining, cluster upgrades, scaling down). This ensures that administrative upgrades do not compromise application availability by taking down too many replicas simultaneously.
β Q15: What are Topology Spread Constraints, and how do they prevent single-zone or single-rack outages?
Click on the dropdown below to reveal the technical answer.
Answer:
Topology Spread Constraints (topologySpreadConstraints) control how pods are distributed across failure domains (nodes, zones, regions, or racks) in a cluster.
This prevents pod replicas from clustering on the same node or in a single zone, mitigating risk if a specific zone goes down.
β Q16: Explain Kubernetes RBAC. What is the difference between a Role and a ClusterRole, and when would you use a RoleBinding over a ClusterRoleBinding?
Click on the dropdown below to reveal the technical answer.
Answer: RBAC is a security mechanism used to regulate access to resources based on user roles and permissions:
default).β Q17: What is a Service Account, and how does a pod use it to communicate securely with the Kubernetes API Server?
Click on the dropdown below to reveal the technical answer.
Answer: A ServiceAccount provides an identity for processes running in pods, allowing them to authenticate against the Kubernetes API Server to perform actions (e.g., a Prometheus pod querying the API to discover other pods).
β Q18: What is a Network Policy, and how do you implement a default-deny ingress rule in a namespace?
Click on the dropdown below to reveal the technical answer.
Answer: A NetworkPolicy defines firewall rules at the pod level, specifying how groups of pods can communicate with each other and with external network endpoints. By default, pods are non-isolated and accept traffic from any source. Enfacing a NetworkPolicy restricts traffic based on labels, namespaces, and ports.
β Q19: What are Pod Security Standards (PSS), and how do baseline and restricted profiles differ?
Click on the dropdown below to reveal the technical answer.
Answer: Pod Security Standards (PSS) define security profiles to restrict pod capabilities, replacing the deprecated PodSecurityPolicies (PSP):
β Q20: What are Admission Controllers? What is the difference between Mutating and Validating Admission Webhooks?
Click on the dropdown below to reveal the technical answer.
Answer: An Admission Controller is a plugin that intercepts API requests to the API Server after authentication and authorization, but before the object is written to etcd:
β Q21: How does the Horizontal Pod Autoscaler (HPA) compute desired replicas? Walk me through the mathematical formula it uses.
Click on the dropdown below to reveal the technical answer.
Answer: The HPA queries metrics (usually CPU/RAM usage from the Metrics Server) at regular intervals (default 15s) and adjusts the replica count of a deployment or statefulset to match a target utilization: $$\text{Desired Replicas} = \lceil \text{Current Replicas} \times (\text{Current Metric Value} / \text{Target Metric Value}) \rceil$$
β Q22: What is the Vertical Pod Autoscaler (VPA), and why can't we use it alongside the HPA on the same resource metrics?
Click on the dropdown below to reveal the technical answer.
Answer: The VPA monitors the actual resource usage of pods over time and automatically adjusts their CPU/RAM requests and limits. This optimizes resource utilization and prevents Out-Of-Memory (OOM) crashes by allocating more resources to pods that need them. Note: Standard VPA requires restarting pods to apply changes. Using VPA and HPA on the same metrics (like CPU/Memory) causes scheduling conflicts because they work against each other (HPA attempts to scale pod counts, while VPA attempts to scale pod sizes).
β Q23: How does the Cluster Autoscaler decide to scale node counts up or down? What events trigger these actions?
Click on the dropdown below to reveal the technical answer.
Answer: The Cluster Autoscaler adjusts the number of virtual machine nodes in the cluster's node groups:
Pending state because the cluster has insufficient CPU/RAM to schedule them.β Q24: What is KEDA (Kubernetes Event-driven Autoscaling), and in what scenarios is it preferred over the standard HPA?
Click on the dropdown below to reveal the technical answer.
Answer: KEDA (Kubernetes Event-driven Autoscaling) is a lightweight component that extends standard autoscaling by allowing pods to scale based on external event sources (e.g., message counts in Kafka, RabbitMQ, or AWS SQS), including scaling deployments down to 0 replicas when there are no events to process.
β Q25: What are Resource Quotas, and how do they prevent a single tenant from starving other namespaces?
Click on the dropdown below to reveal the technical answer.
Answer: ResourceQuotas set constraints on the total resource consumption in a namespace, limiting total CPU requests, memory requests, or object counts (e.g., maximum of 10 Services or 50 Pods).
β Q26: Scenario: Our cluster nodes are crashing under heavy load, causing application downtime. How would you design a highly available cluster infrastructure?
Click on the dropdown below to reveal the technical answer.
Answer: To achieve high availability:
topologySpreadConstraints to force pod replicas to be distributed evenly across zones and nodes.minAvailable: 2) to prevent voluntary node drains from bringing down all app instances during cluster maintenance.β Q27: Scenario: We need to roll out updates to a high-traffic payment service with absolutely zero downtime. What is your deployment and routing strategy?
Click on the dropdown below to reveal the technical answer.
Answer:
maxUnavailable: 0 (keeps all instances active during release) and maxSurge: 25% (provisions extra temporary pods).preStop hook (e.g., sleep 15) to allow the container to finish inflight requests before receiving the SIGTERM signal.β Q28: Scenario: Our cloud monthly bill is skyrocketing due to over-provisioned nodes. How would you optimize resource allocations for workloads?
Click on the dropdown below to reveal the technical answer.
Answer:
Off (recommendation mode) to analyze resource utilization and suggest optimal CPU/RAM configurations, then apply those recommendations.β Q29: Scenario: We are running Kubernetes across AWS, GCP, and on-premises datacenters. How do you manage and synchronize configurations across all clusters?
Click on the dropdown below to reveal the technical answer.
Answer:
β Q30: Scenario: We are storing database passwords as plaintext inside our environment configurations. How do you secure secrets in Kubernetes?
Click on the dropdown below to reveal the technical answer.
Answer:
get and list operations on secrets to cluster admins and specific service accounts.β Q31: Scenario: We need to design a disaster recovery plan for our Kubernetes workloads. How do you implement a backup and restore strategy?
Click on the dropdown below to reveal the technical answer.
Answer:
β Q32: Scenario: Users are complaining that our application is slow, but CPU usage looks normal. How would you systematically diagnose this performance issue?
Click on the dropdown below to reveal the technical answer.
Answer:
container_cpu_cfs_throttled_seconds_total) indicates CPU limits are too low, causing kernel pauses.β Q33: Scenario: We want to roll out a high-risk database-dependent update to 5% of users first. How do you configure a Canary deployment?
Click on the dropdown below to reveal the technical answer.
Answer:
v1.0) active and launch a small canary deployment (v2.0).v1.0 and 5% to v2.0.β Q34: Scenario: Due to strict GDPR compliance, customer data cannot leave the EU. How do you configure our cluster to enforce data residency?
Click on the dropdown below to reveal the technical answer.
Answer:
topology.kubernetes.io/region=eu-west-1). Configure nodeAffinity on GDPR-scoped pods to ensure they schedule only on EU nodes.β Q35: Scenario: We are migrating a monolithic e-commerce application to microservices on Kubernetes. How do you plan this migration?
Click on the dropdown below to reveal the technical answer.
Answer:
cart, payment, inventory) using the Strangler Fig Pattern, wrapping monolithic endpoints in APIs.