What is the difference between a Pod and a container in Kubernetes ?
Answer
A container is the isolated execution unit that runs a single application, with its own dependencies, in the classic Docker sense. A Pod is the smallest deployable unit in Kubernetes, and it can contain one or more containers that share the same network, the same IP address and possibly volumes, and that are always scheduled together on the same node. The most common case is a Pod with a single application container, but multiple containers in one Pod are used for specific needs, like a sidecar handling logging or the network proxy.
Common trap
The trap is believing each container in a multi-container Pod has its own IP address: they all share the Pod's single network address and communicate with each other via localhost, which has direct implications for port management.