title: How can I access the Kubernetes service through ClusterIP
body: <p>I am trying to create Kubernetes cluster using three VMs(Master – 10.x.x.4, Node1  – 10.x.x.150, Node2  – 10.x.x.160).</p>
  
  <p>I was able to create the guestbook application successfully following this link: <a href="http://kubernetes.io/v1.0/examples/guestbook/" rel="noreferrer">http://kubernetes.io/v1.0/examples/guestbook/</a>.  Only one change I made to frontend-service.yaml: to use NodePort. I can access the frontend service using nodes IP and port number(10.x.x.150:30724 or 10.x.x.160:30724). So everything is working as expected but I am not able to access the frontend service using ClusterIP address(in my case 10.x.x.79).</p>
  
  <p>My understanding of NodePort is that the service can be accessed through cluster IP and also on a port on each node of the cluster. How can I access the service through ClusterIP so that I don’t have to access the each node?  Am I missing something here?</p>
  
  <p><strong>service and pod details</strong></p>
  
  <p><strong>$sudo kubectl describe service frontend</strong></p>
  
  <pre><code>Name:                   frontend
  Namespace:              default
  Labels:                 name=frontend
  Selector:               name=frontend
  Type:                   NodePort
  IP:                     10.x.x.79
  Port:                   &lt;unnamed&gt;       80/TCP
  NodePort:               &lt;unnamed&gt;       30724/TCP
  Endpoints:              172.x.x.13:80,172.x.x.14:80,172.x.x.11:80
  Session Affinity:       None
  
  No events.
  </code></pre>
  
  <p><strong>$sudo kubectl describe pod frontend-2b5us</strong></p>
  
  <pre><code>Name:                           frontend-2b5us
  Namespace:                      default
  Image(s):                       gcr.io/google_samples/gb-frontend:v3
  Node:                           10.x.x.150/10.x.x.150
  Labels:                         name=frontend
  Status:                         Running
  Reason:
  Message:
  IP:                             172.x.x.11
  Replication Controllers:        frontend (3/3 replicas created)
  Containers:
    php-redis:
      Image:              gcr.io/google_samples/gb-frontend:v3
      State:              Running
        Started:          Fri, 30 Oct 2015 04:00:40 -0500
      Ready:              True
      Restart Count:      0
  </code></pre>
  
  <p>I tried to search but would not find any solution for my exact problem but I did find similar problem  that looks like for GCE.</p>
  
  <p><a href="https://stackoverflow.com/questions/32618437/why-cant-i-access-my-kubernetes-service-via-its-ip">Why can&#39;t I access my Kubernetes service via its IP?</a></p>