panchalhimself

Networking and CNI in kubernetes

21 June 2023

K8s by default has following :-

pods can communicate with all other pods on any other node without NAT.

agents on a node (e.g. system daemons, kubelet) can communicate with all pods on that node.

each pod has a clusterwise unique ip address.

each pod/service also has dns associated with it as well that can be used for communication instead of ip.

Containers within a Pod use networking to communicate via loopback.

Cluster networking provides communication between different Pods.

The Service API lets you expose an application running in Pods to be reachable from outside your cluster. (Node Port , Load Balancer)

Ingress provides extra functionality specifically for exposing HTTP applications, websites and APIs.

Services for exposing a set of pods inside the cluster for other pods/services to access via abstraction.

CNI handles all the networking, there are many types of them available. We used weavenet and most popular one is calico.

search_query: networking

ref: https://kubernetes.io/docs/concepts/services-networking/#the-kubernetes-network-model