title: Kubernetes pod doesn't accept connections on exposed port
body: <p>I have a multi container pod deployment that exposes port 8080 the port inside the container is accessible through localhost but not the pod IP 
  when I telnet on the pod local host I'm able to connect but when I telnet on the pod IP that's in /etc/hosts I get connection refused.</p>
  
  <p>deployment.yaml</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
   name: test
   namespace: yara
   labels:
     component: test-multi-container-pod
    spec:
   replicas: 1
   template:
     metadata:
       labels:
         app: test
            spec:
       serviceAccountName: test
       containers:
         - name: container-1
           image: "gcr.io/projectID/my-image1:v1.9.3"
           pullPolicy: "IfNotPresent"
           resources:
             limits:
               cpu: 1000m
               memory: 2Gi
              requests:
               cpu: 500m
               memory: 2Gi             
         - name: container2
           image: "gcr.io/projectID/my-image2:0.0.107"
            pullPolicy: "IfNotPresent"
            securityContext:
             runAsUser: 0
           resources:
             limits:
               cpu: 1000m
               memory: 2Gi
             requests:
               cpu: 500m
               memory: 2Gi   
         - name:  "app-container"
         ## nodejs image that exposes ports 3000 &amp; 8080
           image: "gcr.io/projectID/node:8.9.4_1804082101"
           workingDir: "/usr/src/app"
           pullPolicy: "Always"
           command: ["tail", "-f", "/dev/null"]
           ports:
           - name: http
             containerPort: 3000
           - name: graphql
             containerPort: 8080
           resources:
             limits:
               cpu: 1500m
               memory: 2Gi
             requests:
               cpu: 1500m
               memory: 2Gi
  </code></pre>
  
  <p>service.yaml</p>
  
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    name: test-app
    namespace: "yara"
    labels:
      component: test-multi-container-pod
  spec:
    type: NodePort
    ports:
    - protocol: TCP
      name: http
      port: 3000
      targetPort: http
    - protocol: TCP
      name: graphql
      port: 8080
      targetPort: graphql
    selector:
      component: test-multi-container-pod
  </code></pre>