<p>I have a very hard time understanding what kubernetes network architecture is really like.</p>
<p>As a basic understanding &quot;there's a machine behind each IP&quot;, but with this stuff of containers inside pods inside nodes inside a cluster hosted somewhere.</p>
<p>Adding services, deployments and other kubernetes objects, makes it even more confusing. The documentation is not super clear on that. I'm just lost and throwing hands in the air</p>
<p>Could I ask for a brief explanation of what network is inside what network, and what elements have IPs and/or ports?</p>

Sheed
<p>&quot;there's a machine behind each IP&quot;</p>
<p>i am not sure about for which IP you are talking about</p>
<p>There are multiple components in Kubernetes if we focus main</p>
<ul>
<li>POD (It runs docker container)</li>
<li>Deployment</li>
<li>Service</li>
<li>Ingress</li>
</ul>
<p>Now if talk about managing the traffic it's work like</p>
<p>Ingress &gt; ingress controller &gt; Service &gt; deployment &gt; POD &gt; Container</p>
<p>There are IPs assigned to each <strong>PODs</strong> (workloads)</p>
<p>But it's not useful in normal case, it auto managed by K8s nothing to do it with it.</p>
<p>it will be internal IP so you can not connect with workload of POD from out of Kubernetes.</p>
<p>Now we have Type of <strong>Services</strong></p>
<ul>
<li>ClusterIP</li>
<li>Load Balancer</li>
<li>Node Port</li>
</ul>
<p>Cluster IP is the same again internal IP managed by Kubernetes.</p>
<p>The load balancer is exposed to the internet it's like you are attaching the LB to your workload or application so it will be exposed to the internet.</p>
<p>In this case, you will get the external IP open to the internet.</p>
<p>This was like intern arch.</p>
<p>If we talk about simple cluster architecture</p>
<p>There are <strong>master node</strong> and <strong>work nodes</strong></p>
<p>Work nodes have internal and external IP based on you Private Kubernetes cluster or Public Kubernetes cluster.</p>
<p>Each of you container or POD runs on worker node and have internal IP in ideal scenario.</p>
<p>Multiple workloads or containers can run on a single Machine or single VM NODE.</p>
<p>Ports get used the same way we use generally.</p>
<p>For example this is my test service :</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: test
  labels:
    app: test
spec:
  ports:
  - name: http
    port: 80
    targetPort: 9595
  - name: https
    port: 9595
    targetPort: 9595
  selector:
    app: test
    tier: frontend
</code></pre>
<p>it's has exposed two port 80 and 9595. if you look carefully <code>targetPort: 9595</code> there is a target port in both cases it is diverting traffic to the <strong>9595</strong> port on which my container or workload will be running.</p>
