<p>I have been following this tutorial on creating a hello-world app</p>
<p><a href="https://medium.com/@bhargavshah2011/hello-world-on-kubernetes-cluster-6bec6f4b1bfd" rel="nofollow noreferrer">https://medium.com/@bhargavshah2011/hello-world-on-kubernetes-cluster-6bec6f4b1bfd</a></p>
<p>First I create a cluster on gcloud (called hello-world2)</p>
<p><a href="https://i.stack.imgur.com/Gfa4B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gfa4B.png" alt="enter image description here" /></a></p>
<p>then connect to it locally :</p>
<p><a href="https://i.stack.imgur.com/UUp9y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UUp9y.png" alt="enter image description here" /></a></p>
<p>Next I do a <strong>git clone</strong> of the project listed in the article.</p>
<pre><code>git clone https://github.com/skynet86/hello-world-k8s.git
cd hello-world-k8s/
</code></pre>
<p>Inside the directory I find this <strong>hello-world.yaml</strong> .</p>
<p>It basically lists a deployment and service (I have renamed everything from hello-world to hello-world2)</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world2-deployment
  labels:
    app: hello-world2
spec:
  selector:
    matchLabels:
      app: hello-world2
  replicas: 2
  template:
    metadata:
      labels:
        app: hello-world2
    spec:
      containers:
      - name: hello-world2
        image: bhargavshah86/kube-test:v0.1
        ports:
        - containerPort: 80
        resources:
          limits:
            memory: 256Mi
            cpu: &quot;250m&quot;
          requests:
            memory: 128Mi
            cpu: &quot;80m&quot;
---
apiVersion: v1
kind: Service
metadata:
  name: hello-world2
spec:
  selector:
    app: hello-world2
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 30081   
  type: NodePort
</code></pre>
<p>I apply this file by running :</p>
<pre><code>kubectl create -f hello-world.yaml
</code></pre>
<p>Next I run <strong>kubectl get all</strong> and all my services are nicely listed.</p>
<p><a href="https://i.stack.imgur.com/fgi2s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fgi2s.png" alt="enter image description here" /></a></p>
<p>Now, the article claims, I can see my new application by going to this URL : <strong>http://localhost:30081</strong>.</p>
<p>But I get nothing when I navigate to this link :</p>
<p><a href="https://i.stack.imgur.com/IrEnT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IrEnT.png" alt="enter image description here" /></a></p>
<p>What am I doing wrong here?</p>
<p>Also, another question (sorry..). How do I connect this service/deployment to my cluster? is there some kind of <strong>cluster apply service</strong> command which i need to do? Is my service implicitly already connected?</p>

Oliver Watkins
<p>You can do port-foward use</p>
<pre><code>kubectl port-forward &lt;pod_name&gt; 8080:80 
</code></pre>
<p>and then go to your browser <code>http://localhost:8080</code></p>
<p>ABOUT YOUR PROBLEM</p>
<p>Well the link you shared in there application deployed on localhost not on google cloud. So if you want to deploy on google cloud and want to access application in the web browser then you have to create ingress.</p>
<p>But still you can see if your application response, just ssh into one of your VM on kubernetes cluster and do <code>curl http://localhost:30081</code>. because these nodeport are exposed internally and not exposed to outside world that's the reason you can not access it through web browser for that you need some kind of proxy of ingress stuff. I hope these thing clear your understanding</p>
