Kubernetes Mastery : Day 6 : Networking Concepts

Prakhar Gandhi
Google Cloud - Community
3 min readMay 17, 2024

Hey all, So, in this article i am going to focus more towards networking end, the end that seems very cool and easy to me in all aspects. No quantum mechanics.
So , lets understand the Networking models in kubernetes;
Kubernetes supports various networking models, each with its own set of features, configurations, and use cases.

1. Networking Plugins and CNIs:

Kubernetes networking is facilitated by networking plugins, also known as Container Network Interfaces (CNIs). These plugins are responsible for implementing networking functionalities such as pod-to-pod communication, service discovery, and ingress/egress routing.

Each plugin utilizes different mechanisms and architectures to achieve networking within Kubernetes clusters.
For your ref:

2. Overlay Networks:

Many Kubernetes networking solutions rely on overlay networks to facilitate communication between pods running on different nodes within the cluster. Overlay networks encapsulate pod traffic within packets that traverse the underlying network infrastructure. This allows pods to communicate seamlessly regardless of their physical location in the cluster.

                            +----------------------+
| Overlay Network |
+----------------------+
| |
Encapsulates traffic |
| |
traverses network infrastructure
| |
Allows seamless pod communication

3. Underlay Networks:

Underlay networks refer to the underlying physical or virtual network infrastructure on which Kubernetes clusters are deployed. Underlay networks provide the foundational connectivity between nodes and facilitate communication between pods and external resources outside the cluster. Kubernetes networking solutions must integrate effectively with the underlying underlay network to ensure optimal performance and reliability.

                          +------------------------+
| Underlay Network |
+------------------------+
| |
Provides foundational connectivity
| |
Facilitates communication between nodes

4. Network Policies:

Rules specifying allowed pod communication and traffic types. Segments network, enforces security, and prevents unauthorized access.
For instance, it could be Network Policy Automation (NPA). In most of places you might’ve heard about it when people, tend to talk about NPA Migration related stuff.

5. Service Discovery:

Kubernetes services provide an abstraction layer that enables clients to access pods dynamically without needing to know their specific IP addresses. Service discovery mechanisms, such as Kubernetes DNS and service endpoints, allow pods to discover and communicate with services within the cluster. Understanding how service discovery works is crucial for troubleshooting connectivity issues and ensuring reliable communication between components of your applications.

For your ref: Mechanisms include Kubernetes DNS, service endpoints.

6. Load Balancing :

Kubernetes networking models often include built-in load balancing capabilities to distribute incoming traffic across multiple pods within a service. Load balancers help distribute traffic evenly, improve application scalability, and provide fault tolerance by routing requests to healthy pods. Kubernetes supports various load balancing mechanisms, including round-robin, least connections, and IP hash-based load balancing.

7. Integration with External Networks:

Kubernetes clusters often need to communicate with external networks, such as on-premises data centers or public cloud services. Kubernetes networking models should seamlessly integrate with external networks, enabling bidirectional communication between cluster workloads and external resources. Integration with external networks may involve configuring routes, firewalls, and network address translation (NAT) mechanisms to ensure connectivity.

--

--

Prakhar Gandhi
Google Cloud - Community

Google Developer Educator for Jetpack Compose | Google Cloud Innovator | Geek | Cybersecurity | Code | Strategy