I am running 3 nodes in Kubernetes cluster. Each node has the same Pod myApp. I create a service using type NodePort so that all 3 Node is accessible from external. The service yaml looks like below
apiVersion: v1
kind: Service
metadata:
name: myService
labels:
app: myApp
spec:
selector:
app: myApp
type: NodePort
Suppose the Node IP + port of the 3 nodes are:
1. 192.168.18.1:30010
2. 192.168.18.2:30010
3. 192.168.18.3:30010
My questions are:
1. If all the requests comes to the single node with IP (192.168.18.1:30010), will the service load balancing the requests to Pod in other Nodes, or just the target node (IP 192.168.18.1:30010)?
2. If the answer to Question 1 is yes, which mean service can load balancing request. Then do we still need any load balancer.
Thanks