title: Not able to access service from the public ip in kubernetes
body: <p>I am using kubernetes  and run one service. Service is running and is showing in service. But i am not able to access it from the public ip of the instance. Below is my deployment file.</p>
  
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    name: apache-service
  spec:
    selector:
      app: apache
    ports:
    - protocol: TCP
      port: 80
      targetPort: 80
    type: NodePort
  
  ---
  apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
  kind: Deployment
  metadata:
    name: apache-deployment
  spec:
    selector:
      matchLabels:
        app: apache
    replicas: 2 # tells deployment to run 2 pods matching the template
    template:
      metadata:
        labels:
          app: apache
      spec:
        containers:
        - name: apache
          image: mobingi/ubuntu-apache2-php7:7.2
          ports:
          - containerPort: 80
  </code></pre>
  
  <p>Here is my list of service.</p>
  
  <pre><code>NAME             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
  apache-service   NodePort    10.106.242.181   &lt;none&gt;        80:31807/TCP   9m5s
  kubernetes       ClusterIP   10.96.0.1        &lt;none&gt;        443/TCP        11m
  </code></pre>
  
  <p>But when i check the same service from the follwing telnet with the public ip of cluster and node. It is not responding.</p>
  
  <pre><code>telnet public-ip:31807
  </code></pre>
  
  <p>Any type of help will be appreciable. </p>