<p>I am reading the Kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">document about ingress</a>.<br />
If I understand correctly, The Ingress will forward the traffic of the node to services in Kubernetes. For example, when a HTTP request to the node's port 80, then the ingress will forward that data to a service.<br />
<em><strong>My Question is:</strong></em></p>
<ol>
<li>Does this mean the ingress will occupy port 80 of the node? Then if I have another application want to use the port 80 will cause an error?</li>
<li>If the answer to my first question is &quot;yes&quot;, then is it possible to config an Ingress to listen to the other port on a node.</li>
</ol>

欧阳维杰
<p>In k8s, there is no such thing like <strong>Port x80xx is already being used by another application.</strong></p>
<p><strong>Now let me explain why:</strong>
As you know, you have to have a service to expose your application/pods running in k8s cluster.Here, Each service you create will have a unique new k8s cluster internal ip assigned to it.So if you have another service with same port, you will not get that error(Port x80xx is already being used by another application). As that particular error will be raised only when two application tried to get the same ip and port(socket).</p>
<p><strong>Now come to the point of ingress:</strong>
Basically ingress is implemented based on the ingress controller pods running in k8s cluster and yes it has a service.So you can assigned it to any service port(there is pre-defined port) as it will get assigned new cluster ip to it.</p>
<p><strong>Now to expose your service outside of the cluster:</strong>
To expose your service outside the cluster, you can use serviceType either load balancer and nodeport.</p>
<p><strong>NodePort:</strong> A NodePort is an open port on every node of your cluster.As this a port of your node(host machine),you can not assigned one port to multiple service as this will not have different ip rather than a single localhost ip.</p>
<p><strong>Answer of your questions:</strong></p>
<ol>
<li>Does this mean the ingress will occupy port 80 of the node? Then if I have another application want to use the port 80 will cause an error?</li>
</ol>
<p>yes, if you expose your ingress controller service with nodePort 80, then no other service can use this port(<strong>Port x80xx is already being used by another application.</strong> ).Actually you can not do that cause kubernetes only allow nodePort with range above than 30000.</p>
<ol start="2">
<li>If the answer to my first question is &quot;yes&quot;, then is it possible to config an Ingress to listen to the other port on a node.</li>
</ol>
<p>Yes you can use any other port (typically 30000–32767) as NodePort to expose your ingress service and in that case you have to use url like <code>http://host_machin_IP:NodePort</code>.</p>
