Header Ads

Understanding Kubernetes Networking - Kubernetes Basics

This post will explain you about Kubernetes Networking concepts and how it helps us for the communication and its types.

Networking in any architecture or technology is very essential to understand if you want to deploy the applications over the network and also understanding how the network works that will  help you to troubleshoot if you have any network issue. So we must know exactly what is happening in the network and how all the connections are establishing for the communication over the network.

If you are new to kubernetes and want to learn about kubernetes from basics, Refer the below links and also you can checkout all tutorial videos for free on YouTube and do subscribe for more free videos.

What is Kubernetes - Learn Kubernetes from Basics
How to Install Kubernetes on Linux (RedHat / CentOS)
How to Install Kubernetes On Ubuntu 16.04 LTS
How to Create Kubernetes Deployment, Services & Pods Using Kubectl
How to Create Kubernetes YAML for Deployment, Service & Pods
Kubernetes Volumes Explained with Examples
Kubernetes Persistent Volumes and Claims Explained

Also You can Watch this Entire Tutorial video with more examples on our YouTube Channel - Understanding Kubernetes Networking.

Lets get started.

Understanding Kubernetes Networking - Kubernetes Basics

This is a basic kubernetes architecture where you have some worker nodes, and few pods are running on it with couple of containers.  When you have these many components, how all these components are establishing its connection to make the application accessible over the network.? The answer is that happens only through kubernetes networking.

Kubernetes Networking basics

Types of Kubernetes Networking

1. Container to Container Communication:
When you have one or more containers within a pod that shares the same host networking. So pods will get its own IP address, All container shares same ip address but it works on different port. Communication between containers happens within the pod itself on different port. So all containers will be able to communicate each other by default.

2. Pod to Pod communication:
As said earlier, Each pods will get its own ipaddress. there are sub types within Pod to Pod communcation, that is.

Intra-node Pod Network - Communication of pods running on a single node.
Inter-node Pod Network - Communication of pods running in different nodes.

On the first case, each pod running on single worker node will have the communication by default, because All ip address of pods will be different and assigned from your local network. since it shares the same host.
On the second case, when you have pod running on multiple worker nodes, communication between these pods happens through network plugin that will create some route tables. It forwards the traffic from any pod to any destination pods.

3. Pod to Service Communication:
Service is kubernetes resource type that expose our application to outside the cluster. Through which pod can send the traffic to services.

4 External to Service Communication:
In order to access our application from outside the cluster, external traffic should be allowed to reach the server within the cluster.. This can be achieved using these different types.
a. ClusterIP
b. NodePort
c LoadBalancer
d. Externalname

Each types has its own function and purpose.
Cluster IP - It is the default kubernetes service used for internal communcation within the cluster.
Nodeport - It will open a ports on each nodes and traffic will be forwarded  to the service through random port.
Loadbalancer - It is a type that forwards all external traffic to a service through this type.
External Name - it is a type used to access a service internally that is hosted outside cluster through DNS CName or A record..

Hope you have got an idea about kubernetes networking.

Also refer below related articles and checkout all tutorial videos for free on youtube.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.
Powered by Blogger.