Ever felt confused about server, docker, service, container, target or node ports in Kubernetes? This article breaks it down for you, explaining every port in your workflow, from development to deployment Dive in and simplify the complexity today!
Recently I was trying to setup a deployment pipeline on top of our Kubernetes infrastructure.
I was searching for a proper guide on the types of ports and how traffic is navigated between them, and I couldn’t find any ready-made solutions.
After learning about it and solving my problem, I have written this article to help you gain clarity on ports in a simple way and foster discussions.
Perfect for both self-study and helping out a friend!
Communication of Ports:
In the below method, I'm using in
1. Application Server Port (8001)
You probably know this already.
You write your code in your framework of choice.
Either Django, or Node, or Gin, or any of the other options.
These frameworks have their respective run commands.
For example, in Django python manage.py runserver
And we see the Django app being accessible at port 8001
(8001)
App Server Port -> Container Port
When we start the Docker image, it transforms into a "container" - a running instance of your application.
Since we've already exposed a port, the container is ready to accept the incoming traffic and forward it to the Application inside.
3.
The Target Port refers to the port on your Pod which forwards the traffic to the Container Port.
The Target Port is highlighted in red colour below.
, .
SOCIAL SHARE CARD GENERATOR