# Why does k8s allocate node ports for the loadbalancer service?

**URL:** <https://discuss.kubernetes.io/t/why-does-k8s-allocate-node-ports-for-the-loadbalancer-service/28449>\
**Category:** General Discussions\
**Tags:** network\
**Created:** [May 29, 2024, 2:25am UTC](https://discuss.kubernetes.io/t/why-does-k8s-allocate-node-ports-for-the-loadbalancer-service/28449 "2024-05-29T02:25:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luzejia](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/luzejia/32/15083_2.png) [@luzejia](https://discuss.kubernetes.io/u/luzejia)\
**Post date:** [May 29, 2024, 2:25am UTC](https://discuss.kubernetes.io/t/why-does-k8s-allocate-node-ports-for-the-loadbalancer-service/28449/1 "2024-05-29T02:25:03Z")

</div>

like this:

```auto
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
istio-ingressgateway LoadBalancer 172.17.247.112 23.91.98.160 15021:47711/TCP,80:37888/TCP,443:33064/TCP,31400:32642/TCP,15443:45164/TCP 2d10h

```

k8s allocates an additional port for each port of the loadbalancer, so that in addition to passing lb ip(exp:23.91.98.160:80), traffic can also come in through node ip + node port(node-ip:37888).

What is the reason for doing this?

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [May 29, 2024, 4:37am UTC](https://discuss.kubernetes.io/t/why-does-k8s-allocate-node-ports-for-the-loadbalancer-service/28449/2 "2024-05-29T04:37:25Z")

</div>

Some LBs were implemented in terms of NodePorts, and it seemed like a simpler API to have them “stack”.

---

<div class="post-metadata">

**Author:** ![luzejia](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/luzejia/32/15083_2.png) [@luzejia](https://discuss.kubernetes.io/u/luzejia)\
**Post date:** [May 29, 2024, 6:29am UTC](https://discuss.kubernetes.io/t/why-does-k8s-allocate-node-ports-for-the-loadbalancer-service/28449/3 "2024-05-29T06:29:25Z")

</div>

Thank you so much!
