Junior — Middle
Can you explain the difference between a pod and a container in Kubernetes?
sobes.tech AI
Answer from AI
In Kubernetes, a pod is the smallest and most basic deployable unit that can contain one or more containers. Containers within a pod share the network (IP address, ports) and storage (volumes).
A container is an isolated environment in which an application or service runs, typically based on Docker or another runtime.
In other words:
- A pod is a wrapper that groups one or more containers, providing them with a shared context.
- A container is a process that is directly running an application.
Example: if you have an application and a sidecar container for logging, they will be in the same pod to share an IP and exchange files through a shared volume.