<p>I am a newbie to Kubernetes and trying to install Kubernetes locally on my Mac machine.</p>
<p>I am following the below tutorial on Kubernetes website</p>
<p><a href="https://minikube.sigs.k8s.io/docs/start/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/start/</a></p>
<p>Now, I am at a step where it tells to deploy simple application in my local cluster. I deployed it. Now when I try to access my service using the following command</p>
<pre><code>minikube service hello-minikube
</code></pre>
<p>It launches the browser. Though the browser never shows the service and keeps hanging at 127.0.0.1.</p>
<p>Due to the above problem, I used to the following command</p>
<pre><code>kubectl port-forward service/hello-minikube 7080:8080
</code></pre>
<p>When i try to launch my browser using http://localhost:7080/</p>
<p>I get error attached in the snapshot which is a connection refused issue.
<a href="https://i.stack.imgur.com/dW1Ba.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dW1Ba.png" alt="enter image description here" /></a></p>
<p>Can someone guide me what's going wrong here?</p>
<p>Cheers,</p>
<p><strong>After the below answer</strong></p>
<p>I tried both of the commands, but the browser keeps revolving, but the service is never loaded. Here is a snapshot for you</p>
<p><a href="https://i.stack.imgur.com/uC8XU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uC8XU.png" alt="enter image description here" /></a></p>
<p><strong>YAML File</strong>
<a href="https://i.stack.imgur.com/jmKke.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jmKke.jpg" alt="enter image description here" /></a></p>
<p><strong>Added Endpoints</strong>
<a href="https://i.stack.imgur.com/HjfaP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HjfaP.png" alt="enter image description here" /></a></p>
<p><strong>Pods Status</strong>
<a href="https://i.stack.imgur.com/r9cjd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r9cjd.png" alt="enter image description here" /></a></p>
<p><strong>Adding Docker Image<a href="https://i.stack.imgur.com/y40TO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y40TO.jpg" alt="Docker Image" /></a></strong></p>
<p><strong>Events Command update</strong>
<a href="https://i.stack.imgur.com/wqMlZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wqMlZ.jpg" alt="Events command error" /></a></p>

benz
<p>to access your application either use <code>minikube tunnel</code> and then access it by one of the endopoints of your servers IPs and and port.</p>
<p>Another option would be to expose your application via a service of type NodePort and then use <code>minikube service $servicename</code></p>
<p>Edit:</p>
<p>just a quick sanity check, can you try running the following commands?</p>
<pre><code>$ kubectl create deployment nginx --image nginx --port 80 
$ kubectl expose deployment nginx --name nginx-svc --type NodePort
$ minikube service nginx-svc
</code></pre>
<p>--&gt; this should open your browser with IP of minikube cluster using the services NodePort and you should see the nginx welcome page</p>
<p>The other way you should be able to access the service is, after creation of deployment and service:</p>
<pre><code>$ minukube tunnel nginx-svc 
$ kubectl port-forward $nginx-podname 8080:80
</code></pre>
<p>--&gt; browsing to localhost:8080 should show nginx welcome page.</p>
<p>Please check if this is how your setup currently behaves. if it doesn't there's a problem in your setup that needs to be further explored. if it does, please share your yaml resources, so we might be able to find the problem</p>
