Kubernetes  Networking basics

Kubernetes Networking basics

Kubernetes is an orchestration tool (container management tool), which is used to perform AutoScaling either vertically or horizontally for example scale up when no. of users increases and scale down when no. of users decreases.

Auto-healing if the node crashes or any pod is destroyed.

Load balancing takes care that the load is distributed equally among the nodes.

Run your own cloud on your own machine, and migrate it from one provider to other.

Nodes are present inside a Kubernetes Cluster which is managed by the master. Pods are created inside a node and containers are created inside a pod ex: Docker.

Below is a visual example of the Kubernetes cluster.

Kubernetes Architecture

Components of Control Plane(Master)

1)Kube-ApiServer = This interacts directly with the user(Front End)

2)ETCD = This stores metadata and the status of the cluster, data of data.

3)Kube-Scheduler = It decides which pod will go on which node as soon as the pod is created. It makes sure that no pods are unassigned.

4)Control Manager = is a Daemon that makes sure that desired state is equal to the current state. ex:- If the desired state is 3 pods then it makes sure that 3 pods are running currently.

What happens inside the node?

Containers within a pod use networking to communicate via loopback. Inside the node, pods are created on which containers run. These containers don't have any IP addresses only the pods have IP addresses. The containers communicate which each other inside a node through localhost.

Kubelet is responsible for all the communications between the Kubernetes control plane and the nodes where the actual workload runs.

Pods communicate with each other through assigned IP addresses inside a node or within the same node. Kubeproxy assigns IP addresses to nodes.

To access pod IP outside the node we can specify port no. then access the pod outside the node. like ( pod IP number: port no) this is done using NodePort.

Volumes are attached to a pod inside a node. One volume can be shared among many pods inside a node. Data are shared within pods through volume and if one pod crashes the data is not lost if it is connected to a volume.

I will write a new blog related to volumes, types, and functions. Keep reading :)

Did you find this article valuable?

Support Mohd Athar Shoyeb by becoming a sponsor. Any amount is appreciated!