<p>I am unable to connect to an exposed IP for a docker container deployed on Google Could Kubernetes. I have been roughly following <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app" rel="noreferrer">this tutorial</a> but using my own application.</p>

<p>The deployment seems to work fine, everything is green and running when visiting the cloud dashboard but when trying to visit the deployed application on the exposed IP, I get a browser error:</p>

<blockquote>
  <p>This site can’t be reached
  35.231.27.158 refused to connect</p>
</blockquote>

<p>If I ping the IP I do get a response back.</p>

<p><code>kubectl get pods</code> produces the following:</p>

<pre><code>NAME                        READY     STATUS    RESTARTS   AGE
mtg-dash-7874f6c54d-nktjn   1/1       Running   0          21m
</code></pre>

<p>and <code>kubectl get service</code> shows the following:</p>

<pre><code>NAME         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)        AGE
kubernetes   ClusterIP      10.7.240.1     &lt;none&gt;          443/TCP        23m
mtg-dash     LoadBalancer   10.7.242.240   35.231.27.158   80:30306/TCP   20m
</code></pre>

<p>and <code>kubectl describe svc</code> show the following:</p>

<pre><code>Name:                     mtg-dash
Namespace:                default
Labels:                   run=mtg-dash
Annotations:              &lt;none&gt;
Selector:                 run=mtg-dash
Type:                     LoadBalancer
IP:                       10.7.242.240
LoadBalancer Ingress:     35.231.27.158
Port:                     &lt;unset&gt;  80/TCP
TargetPort:               8080/TCP
NodePort:                 &lt;unset&gt;  30306/TCP
Endpoints:                10.4.0.6:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason                Age   From                Message
  ----    ------                ----  ----                -------
  Normal  EnsuringLoadBalancer  37m   service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   37m   service-controller  Ensured load balancer
</code></pre>

<p>My <code>Dockerfile</code> contains the following:</p>

<pre><code>FROM nginx:alpine

COPY nginx.conf /etc/nginx/nginx.conf

WORKDIR /usr/share/nginx/html

COPY dist/mtg-dash .
</code></pre>

<p>I have a feeling I have missed something obvious. </p>

<p><strong>What more do I need to do to configure this to be accessible on the internet?</strong></p>

<p>Here is a screenshot of running service:</p>

<p><a href="https://i.stack.imgur.com/h8SNP.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/h8SNP.jpg" alt="enter image description here"></a> </p>

<p>As per the comments the target port should be 80 since that is what the application is set to listen on. Glad I could help. Picked it up from the documentation a month or so ago.</p>

<p><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/</a></p>
