<p>Most software tech has a &quot;Hello World&quot; type example to get started on. With Kubernetes this seems to be lacking.</p>
<p>My scenario cannot be simpler. I have a simple hello world app made with Spring-Boot with one Rest controller that just returns: &quot;Hello Hello!&quot;</p>
<p>After I create my docker file, I build an image like this :</p>
<pre><code>docker build -t helloworld:1.0 .
</code></pre>
<p>Then I run it in a container like this :</p>
<pre><code>docker run -p 8080:8080 helloworld:1.0
</code></pre>
<p>If I open up a browser now, I can access my application here :</p>
<pre><code>http://localhost:8080/hello/
</code></pre>
<p>and it returns :</p>
<pre><code>&quot;Hello Hello!&quot;
</code></pre>
<p><em>Great! So far so good.</em></p>
<p>Next I tag it (my docker-hub is called ollyw123, and the ID of my image is 776...)</p>
<pre><code>docker tag 7769f3792278 ollyw123/helloworld:firsttry
</code></pre>
<p>and push :</p>
<pre><code>docker push ollyw123/helloworld
</code></pre>
<p>If I log into Docker-Hub I will see</p>
<p><a href="https://i.stack.imgur.com/c1CCO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c1CCO.png" alt="enter image description here" /></a></p>
<p>Now I want to connect this to Kubernetes. This is where I have plunged deep into the a state of confusion.</p>
<p>My thinking is, I need to create a <strong>cluster</strong>. Somehow I need to connect this cluster to my <strong>image</strong>, and as I understand, I just need to use the URL of the image to connect to (ie.
<a href="https://hub.docker.com/repository/docker/ollyw123/helloworld" rel="nofollow noreferrer">https://hub.docker.com/repository/docker/ollyw123/helloworld</a>)</p>
<p>Next I would have to create a <strong>service</strong>. This service would then be able to expose my &quot;Hello World!&quot; rest call through some port. This is my logical thinking, and for me this would seem like a very simple thing to do, but the tutorials and documentation on Kubernetes is a mine field of confusion and dead ends.</p>
<p>Following on from the spring-boot kubernetes tutorial (<a href="https://spring.io/guides/gs/spring-boot-kubernetes/" rel="nofollow noreferrer">https://spring.io/guides/gs/spring-boot-kubernetes/</a>) I have to create a deployment object, and then a service object, and then I have to &quot;apply&quot; it :</p>
<pre><code>kubectl create deployment hello-world-dep --image=ollyw123/helloworld --dry-run -o=yaml &gt; deployment.yaml

kubectl create service clusterip hello-world-dep --tcp=8080:8080 --dry-run -o=yaml &gt;&gt; deployment.yaml

kubectl apply -f deployment.yaml
</code></pre>
<p>OK. Now I see a service :</p>
<p><a href="https://i.stack.imgur.com/8O9TY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8O9TY.png" alt="enter image description here" /></a></p>
<p>But now what???</p>
<p>How do I push this to the cloud? (eg. gcloud) Do I need to create a cluster first, or is this already a cluster?</p>
<p>What should my next step be?</p>

Oliver Watkins
<p>The service that you have is of type <code>clusterIP</code> which is only accessible from within the kubernetes cluster. You need to either use <a href="https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/" rel="nofollow noreferrer"><code>NodePort</code></a> or <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/" rel="nofollow noreferrer"><code>LoadBalanacer</code></a> type service or <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer"><code>ingress</code></a> to expose the application outside the remote kubernetes cluster(a set of VMs or bare metal servers in public or private cloud environment with kubernetes deployed on them) or local minikube/docker desktop. Once you do that you should be able to access it using a browser or curl</p>
