2 Answers
I also picked the load balancer answer. I did some reading and it looks like the load balancer is intended for exposing to the public internet. The quoted text below and the link to the documentation does a better job of explaining than I can.
.
“LoadBalancer: Exposes the Service externally using a cloud provider’s load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.”
.
Source:
.
[https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)
As I understand:-
Port → to access within cluster using ClusterIP
NodePort → To access from outside of cluster, using nodeIP, within LAN.
LoadBalancer → To access from Public.
So, Nodeport answer is correct, as question talks about LAN.
I agree with you.. Since there is no External access mentioned in the question, NodePort seems to be the correct. Usually in this kind of tech tests, you need to remember ( "Ok there is "2" correct here), let me check witch is the cheaper, os faster that meet the question requirements… In this case NodePort
I had the same answer – which I think is more correct although NodePort would also work. I think the failure case you point out would not be solved by NodePort but would by LoadBalancer. FYI – I’m not a K8S expert by any means…