Kubernetes - Nodeport vs Loadbalancer

2/9/2020

Im new in kubernetes and i am studying the performance of load balancer and Nodeport ,in my research I can't find something about which is better/fastest it is anyway to know which is faster or give best performance?

-- R.O.O.T
kubernetes

2 Answers

2/9/2020

I believe the context is really important in order to decide which one is better. If you're serving streaming applications then load-balancer is much better than node-port. But if you're just using a single endpoint which is used by only 10-100 users in a day node port will do just fine for you.

-- vinay_kumar
Source: StackOverflow

2/9/2020

Generally, there should be no visible difference in performance between node-port and load-balancer type services: all the load balancers do after all is relaying traffic, so if they are located close enough to the cluster itself (and I'd bet all providers such as eks, gke, aks do so) then you can expect about a 1ms increased latency max. And if the load-balancers are setup on the cluster itself or using the BGP router that routes traffic to a given cluster, then there will be no difference in latency at all.

The main advantage of using load-balancer type over node-port is that it gives you a single stable VIP for your service, while in case of node-port the set of IPs on which your service is available will be changing as nodes in your cluster go down and up or are added or removed.

-- morgwai
Source: StackOverflow