Pregunta de Networking #019e3a4f
What is a key feature of a container network?
Proxying REST requests across a set of containers.
Allowing containers running on separate hosts to communicate.
Allowing containers on the same host to communicate.
Caching remote disk access.
Explicación Oficial / Explicaciones de la Comunidad
A key feature of a container network is enabling communication between containers running on separate hosts. This is typically achieved through overlay networks, which encapsulate container traffic and route it across hosts, allowing containers to communicate as if they were on the same local network. Technologies like Docker's overlay driver, Flannel, Calico, or Weave implement this by creating a virtual network that spans multiple hosts.
How it Works
Container networks use network namespaces to isolate each container's network stack. For cross-host communication, an overlay network creates a virtual Layer 2 or Layer 3 network on top of the physical host network. Each container gets an IP address from the overlay subnet, and traffic is encapsulated (e.g., using VXLAN or IPsec) and forwarded to the correct host. This allows containers on different hosts to communicate directly without port mapping or proxy services.
Why the Correct Answer is Right
Allowing containers on separate hosts to communicate is a fundamental requirement for distributed applications. Without this, containers would be isolated to a single host, limiting scalability and fault tolerance. Container orchestration platforms like Kubernetes rely on this feature to enable pod-to-pod communication across nodes.
Why the Incorrect Answers are Wrong
- Proxying REST requests across a set of containers: This describes a reverse proxy or load balancer, not a core feature of container networking. While proxies can be used with containers, they are not inherent to container networks.
- Allowing containers on the same host to communicate: This is a basic capability of container networking, but it is not a key feature distinguishing container networks from other networking models. Cross-host communication is more significant because it enables distributed systems.
- Caching remote disk access: This relates to storage or caching mechanisms (e.g., distributed filesystems), not networking. Container networks focus on packet forwarding and connectivity, not data caching.