<p>I have an EKS cluster with only private subnets, i tried to expose a simple nginx service on nodePort and then check this url private-node-ip:nodePort on the browser but its showing <strong>this site can't be reached</strong></p>

<p>here is my code :</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  type: NodePort
  ports:
  - port: 80
    name: http
    targetPort: 80
  selector:
    app: nginx
</code></pre>

touati ahmed
<p>Your <code>port: 80</code> value for the NodePort is outside the default allowable range (30000 to 32767) on kubernetes. This range can be changed, see for example <a href="https://stackoverflow.com/questions/54752821/how-to-set-service-node-port-range-and-then-be-able-to-deploy-services-using-the">here</a> but I don't think you can expose the low port numbers with NodePort, though I'm open to correction. Hope this helps.</p>

<p>Edit - I misread the question above, and my original answer is incorrect. If your service had said <code>NodePort: 80</code>, then the range would have been an issue. </p>

<p>But, reading your question again, NodePort is usually exposed for a public IP. If your cluster doesn't have a public IP, then the machine where you're browsing from will need to be on the same private network as your cluster. It won't be exposed to the public Internet. See <a href="https://github.com/Azure/AKS/issues/518" rel="nofollow noreferrer">here</a> for some discussion on the issue. </p>
