<p>I have created a VPC-native cluster on GKE, master authorized networks disabled on it.
I think I did all things correctly but I still can't access to the app externally.</p>
<p>Below is my service manifest.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
    annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.16.0 (0c01309)
    creationTimestamp: null
    labels:
        io.kompose.service: app
    name: app
spec:
    ports:
        - name: '3000'
          port: 80
          targetPort: 3000
          protocol: TCP
          nodePort: 30382
    selector:
        io.kompose.service: app
    type: NodePort

</code></pre>
<p>The app's container port is <code>3000</code> and I checked it is working from logs.
I added firewall to open the <code>30382</code>port in my vpc network too.
I still can't access to the node with the specified nodePort.
Is there anything I am missing?</p>
<hr />
<p><strong>kubectl get ep</strong>:</p>
<pre class="lang-sh prettyprint-override"><code>NAME         ENDPOINTS          AGE
app          10.20.0.10:3000    6h17m
kubernetes   34.69.50.167:443   29h
</code></pre>
<p><strong>kubectl get svc</strong>:</p>
<pre class="lang-sh prettyprint-override"><code>NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGE
app          NodePort    10.24.6.14   &lt;none&gt;        80:30382/TCP   6h25m
kubernetes   ClusterIP   10.24.0.1    &lt;none&gt;        443/TCP        29h
</code></pre>

<p>In Kubernetes, the <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">service</a>  is used to communicate with pods.</p>

<p>To expose the pods outside the kubernetes cluster, you will need k8s service of <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer"><code>NodePort</code></a> type.</p>

<p>The <code>NodePort</code> setting applies to the Kubernetes services. By default Kubernetes services are accessible at the ClusterIP which is an <strong>internal</strong> IP address reachable from inside of the Kubernetes cluster only. The ClusterIP enables the applications running within the pods to access the service. To make the service accessible from outside of the cluster a user can create a service of type NodePort.</p>

<p>Please note that it is needed to have <strong>external</strong> IP address assigned to one of the nodes in cluster and a Firewall rule that allows ingress traffic to that port. As a result kubeproxy on Kubernetes node (the external IP address is attached to) will proxy that port to the pods selected by the service.</p>
