Skip to main content
InterviewHubPRO
Section Overview
Q2

Question 2 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

4%
Kubernetes (K8s) (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What is a Pod, and why is it the smallest deployable unit in Kubernetes?

junior LevelMost AskedCode ExampleKubernetes

In Simple Words: Kubernetes does not run containers directly; it wraps one or more containers into a Pod.

  • Shared Context: All containers in a Pod share the exact same:
    1. Network Namespace: Same IP address, port space, and localhost loopback interface. Containers inside the same Pod communicate via localhost:PORT.
    2. Storage Volumes: Mounted storage volumes can be accessed simultaneously by all containers in the Pod.
    3. IPC Namespace: Shared inter-process memory communication.
  • Sidecar Pattern: A primary web application container runs alongside a helper container (e.g., Envoy proxy, log shipper, or secret refresher) sharing lifecycle and localhost networking.
lua
+-------------------------------------------------------+
|                       Pod                             |
|  IP: 10.244.1.42                                      |
|                                                       |
|  +-----------------------+  +----------------------+  |
|  | Main App Container    |  | Logging Sidecar      |  |
|  | (e.g., Node.js API)   |  | (e.g., Fluent Bit)   |  |
|  | Port: 8080            |  | Reads shared volume  |  |
|  +-----------------------+  +----------------------+  |
|              \                     /                  |
|               v                   v                   |
|           [ Shared Pod Volumes: /var/log ]            |
+-------------------------------------------------------+