How to load balance sockets using ingress nginx How to load balance sockets using ingress nginx kubernetes kubernetes

How to load balance sockets using ingress nginx


I am assuming you are using the following architecture to reach your pod:

Ingress controller ---> kubernetes service ---> kubernetes deployment (POD)

If this is the case, then you are using load balancing with a statistical round robin policy already. For which I would conclude that your deployment only has one replica. Check the amount of replicas by running kubectl describe deployment $YOUR_DEPLOYMENT. Increase the amount of replicas by running kubectl scale deployment --replicas=5.

In case you are using a different architecture I would need to check it in order to verify why load balancing is not working. Most likely you are not using a Deployment bud a Pod to deploy your container.