<h1><strong>Failed to connect to localhost port 80: Connection refused</strong></h1>
<p>I recently switched from Windows 10 to Ubuntu 20.04.2 LTS and now I wanted to keep on learning kubernetes. However currently I cannot acess my kubernetes deployment for some reason.</p>
<h1></h1>
<p><em><strong><code>Deployment.yml</code></strong></em></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-deployment-c51e9e6b
spec:
  replicas: 2
  selector:
    matchLabels:
      app: hello-kubernetes
  template:
    metadata:
      labels:
        app: hello-kubernetes
    spec:
      containers:
        - image: paulbouwer/hello-kubernetes:1.7
          name: hello-kubernetes
          ports:
            - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: hello-service-9878228b
spec:
  ports:
    - port: 80
      targetPort: 8080
  selector:
    app: hello-kubernetes
  type: LoadBalancer

</code></pre>
<p>I'm pretty sure that this deployment has worked before so I assume that kubernetes has maybe not permissions to expose the port or something like that?</p>
<h3>Additional information</h3>
<ul>
<li>I'm running a minikube cluster.</li>
<li>Output of kubectl get services: <a href="https://i.stack.imgur.com/evWbT.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/evWbT.jpg</a></li>
</ul>

Chrizz
<p>why do you think you can access it via localhost directly?</p>
<p>If you need, please do the <code>port forward</code>, such as:</p>
<pre><code>kubectl port-forward service/hello-service-9878228b 80:80
</code></pre>
<p>and you need keeping the console on.</p>
<p>then you should be fine to access it via http://localhost</p>
