I knew the HPA basics well enough, talked about CPU thresholds and how the metrics server feeds into it.
Structure your answer by clearly distinguishing between the two levels of autoscaling — pod-level (HPA/VPA) and node-level (Cluster Autoscaler/Karpenter) — and explain how they complement each other. Use a concrete scenario, such as a traffic spike, to illustrate how both layers interact in practice. Conclude with trade-offs and tuning considerations to show depth.
Pro tip: Mention that HPA and Cluster Autoscaler work in tandem but can have timing mismatches — pods may enter a 'Pending' state before new nodes are provisioned — and that tools like Karpenter address this with faster, more intelligent node provisioning. This shows real-world operational awareness beyond textbook knowledge.
Briefly introduce pod-level autoscaling (HPA and VPA) and node-level autoscaling (Cluster Autoscaler and Karpenter) to set a clear structure for your answer. Clarify that they solve different problems: workload scaling vs. infrastructure scaling.
Describe how HPA monitors metrics (CPU, memory, or custom metrics via the Metrics Server or Prometheus adapter) and adjusts the number of pod replicas within a Deployment or StatefulSet. Mention the control loop, cooldown periods, and scaling thresholds.
Explain that VPA adjusts CPU and memory resource requests/limits for individual pods based on historical usage, and note that it typically requires pod restarts to apply changes. Highlight when VPA is preferred over HPA (e.g., single-threaded workloads that can't scale horizontally).
Describe how the Cluster Autoscaler watches for unschedulable pods (Pending state) and provisions new nodes from a cloud provider's node group, and how Karpenter improves on this with faster, more flexible, cost-aware node provisioning. Mention scale-down logic — nodes are removed when underutilized for a configurable period.
Address real-world considerations such as HPA/VPA conflicts (they shouldn't both manage the same resource), cold-start latency during scale-out, and the importance of setting proper resource requests for autoscaling to function correctly. Mention KEDA as an advanced option for event-driven autoscaling.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
Start by outlining the high-level path from external client to pod, then drill into each component (LoadBalancer, Ingress, Service, kube-proxy, CNI). Emphasize how Kubernetes decouples stable virtual IPs from ephemeral pod IPs and how routing decisions are made at each hop.
Pro tip: Mention that while kube-proxy in iptables mode is common, modern clusters often use IPVS or eBPF (Cilium) for better performance and scalability—showing awareness of production trade-offs.
Explain how traffic reaches the cluster via a cloud LoadBalancer or NodePort, which forwards to a Service virtual IP.
If using Ingress, describe how an Ingress controller (e.g., NGINX) terminates TLS and routes based on host/path to a backend Service.
Detail how the Service selects pods via label selectors and maintains Endpoints (or EndpointSlices) with pod IPs and ports.
Describe how kube-proxy programs iptables/IPVS rules to DNAT the Service VIP to a chosen pod IP, often with round-robin or random selection.
Explain how the CNI plugin routes the packet to the target pod's network namespace, where the container receives it.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
Start by defining both controllers in terms of their core design goals: ReplicaSet ensures a specified number of identical, stateless pods are running, while StatefulSet provides stable network identities, persistent storage, and ordered deployment/scaling for stateful applications. Then compare them across key dimensions like identity, storage, scaling, and use cases, and finish with concrete examples of when to choose each.
Pro tip: Mention that ReplicaSet is rarely used directly—it's usually managed by a Deployment—and that StatefulSet is essential for distributed systems like databases and message queues where pod identity and persistent storage matter. This shows you understand the broader Kubernetes ecosystem.
Explain that ReplicaSet maintains a stable set of replica pods for stateless workloads, while StatefulSet manages stateful applications by providing unique, stable identities and persistent storage.
Contrast them on pod identity (random vs. ordinal), storage (shared or none vs. per-pod PersistentVolumeClaims), network identity (no stable hostname vs. stable hostname via headless service), and scaling behavior (parallel vs. ordered).
Give examples: ReplicaSet for stateless web servers or workers; StatefulSet for databases (e.g., MySQL, Cassandra), message queues (e.g., Kafka), or any app needing stable storage and identity. Highlight trade-offs like complexity and slower scaling with StatefulSets.
Conclude that you choose ReplicaSet (usually via Deployment) for stateless, interchangeable pods, and StatefulSet when pods require stable identity, persistent storage, or ordered operations.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.