<p>I have created a Node port service in Google cloud with the following specification...    I have a firewall rule created to allow traffic from 0.0.0.0/0 for the port '30100' ,I have verified stackdriver logs and traffic is allowed but when I either use curl or from browser to hit  http://:30100 I am not getting any response. I couldn't proceed how to debug the issue also... can someone please suggest on this ?</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginxv1
  template:
    metadata:
      labels:
        app: nginxv1
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 8080
---    
apiVersion: v1
kind: Service
metadata:
  name: nginxv1
  namespace: default
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 8080
    nodePort: 30100
  selector:
    app: nginxv1
  type: NodePort

</code></pre>
<p>Thanks.</p>

deals my
<p>You need to fix the container port, it must be <code>80</code> because the nginx container exposes this port as you can see <a href="https://hub.docker.com/_/nginx" rel="nofollow noreferrer">here</a></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginxv1
  template:
    metadata:
      labels:
        app: nginxv1
    spec:
      containers:
      - name: nginx
        image: nginx:latest
---    
apiVersion: v1
kind: Service
metadata:
  name: nginxv1
  namespace: default
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
    nodePort: 30100
  selector:
    app: nginxv1
  type: NodePort
</code></pre>
<p>Also, you need to create a firewall rule to permit the traffic to the node, as mentioned by @danyL in comments:</p>
<pre><code>gcloud compute firewall-rules create test-node-port --allow tcp:30100
</code></pre>
<p>Get the node IP with the command</p>
<pre><code>kubectl get nodes -owide
</code></pre>
<p>And them try to access the nginx page with:</p>
<pre><code>curl http://&lt;NODEIP&gt;:30100
</code></pre>
