Welcome to the Linux Foundation Forum!

Lab 2.3: Confusion regarding NodePort service and Cluster IP

tianli
tianli Posts: 1
edited November 2020 in LFD259 Class Forum

Although I'm able to complete Lab 2.3 - "Create a basic Pod", I am a bit confused about how the NodePort service works. After creating a service of type "NodePort":

  • How come the "EXTERNAL-IP" Column of the service "basicservice" is "none", instead of the Node IP?
  • I could query the nginx app through both the master-node IP AND the worker-node IP. I thought the pod is assigned to one of the nodes, so how come it is accessible through the external IP of either node?
  • When people say "External Cluster IP", do they just mean one of the Node's IPs?

Comments

  • Hi @tianli,

    Services are covered in detail in Chapter 7, but before reaching that chapter I may be able to provide some clarification:

    • The EXTERNAL-IP property of the Service is not the Node IP, it is typically a Load Balancer's IP address, and it is populated for LoadBalancer type Services in Kubernetes clusters running as managed cloud services. We are running a self-managed cluster. If our node is configured to act as a Load Balancer, then its IP address may be assigned to EXTERNAL-IP. An example with additional details can be found here.
    • You are correct, the Pod is assigned to one of the Nodes, but reviewing the "Pod-to-Pod Communication" page of the course should answer your question as to why a Pod running on any Node is accessible from either Node of the cluster.
    • I am not sure, however, what is the "External Cluster IP" you are asking about. Did you find this in the course lectures or the lab exercises?

    Regards,
    -Chris

Categories

Upcoming Training