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:
- Network Namespace: Same IP address, port space, and
localhostloopback interface. Containers inside the same Pod communicate vialocalhost:PORT. - Storage Volumes: Mounted storage volumes can be accessed simultaneously by all containers in the Pod.
- IPC Namespace: Shared inter-process memory communication.
- Network Namespace: Same IP address, port space, and
- 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 ] |
+-------------------------------------------------------+