DEV Community

Cover image for Kubernetes Pods vs Containers | K8s Networking Basics πŸ’‘
TechWorld with Nana
TechWorld with Nana

Posted on • Updated on

Kubernetes Pods vs Containers | K8s Networking Basics πŸ’‘

In this video I cover one part of the broader Kubernetes Networking topic, which is container communication inside pods.

Considering Pods mostly contain only 1 main container, I start by answering the question of why having a Pod as an abstraction over container is such an important concept in Kubernetes.

I show how container port mapping is a problem with hundreds of containers, specifically how to allocate ports without getting conflicts, and how Pods solve this port allocation problem. πŸ’ͺ🏼

Using containers directly, you can only use a specific port once on a server:
Port mapping without pods

The same port can be used multiple times:
Using pods

In addition, I show you in which cases you would need to run multiple containers in one pod and how these containers communicate with each other inside this pod:

Container communication inside a pod

You can find the full video here:


Complete Kubernetes Networking Course 🎬:

I'm making a complete course about Kubernetes Networking, covering rest of the topics, like
β–Ί how pods communicate with each other on the same node and across hundreds of servers?
β–Ί how does the outside world communicate with K8s cluster?
β–Ί how K8s cluster plugs into the underlying infrastructure network?
β–Ί Docker Container Networking

Kubernetes Networking topics


Kubernetes 101 β–Ί Compact and easy-to-read ebook bundle πŸš€
It's a handy way to quickly look something up or refresh your knowledge at work and use it as your cheatsheet 😎

I'm happy to connect with you on πŸ™‚

Top comments (4)

Collapse
 
tkscuba profile image
tkscuba

Hi Nana, Do you have any blogs or best practices around high performance requirements related to persistent volumes? I'm looking for suggestions on how to build out air gap on prem kubernetes (openshift) systems where there is a requirement for high speed IO performance for things like home directories or data directories to feed in memory k8s applications. Choking things through a proxy into a virtual network is not good for performance. So wondering how best to share storage up through the kubernetes worker. Was wondering if you had shared anything in that tech area. Love the videos and blog posts, definitely sharing your site with our team. Thank you.

Collapse
 
jouo profile image
Jashua

Hey Nana, have you ever thought of making a course? you got the knowledge and editing skills! :)

Collapse
 
techworld_with_nana profile image
TechWorld with Nana

Hi Jashua, that's nice of you thanks :) Yes, I'm working on my first course right now, which is gonna be a complete K8s Networking tutorial.

Collapse
 
vray27 profile image
Vikas Ray

I have question regarding pod.

Condition: kube scheduler not working.
How would you assign/reassign a pod to a Node using a Binding object?