<p>I am trying to do this tutorial <a href="https://kubernetes.io/blog/2019/07/23/get-started-with-kubernetes-using-python/" rel="nofollow noreferrer">https://kubernetes.io/blog/2019/07/23/get-started-with-kubernetes-using-python/</a> on my local machine</p>
<p>I have accomplished all of the steps:</p>
<pre><code>app git:(master) ✗  kubectl get pods

NAME                            READY   STATUS    RESTARTS   AGE
hello-python-6c7b478cf5-49vdg   1/1     Running   0          2m53s
hello-python-6c7b478cf5-d4tfl   1/1     Running   0          2m53s
hello-python-6c7b478cf5-ltb8r   1/1     Running   0          2m53s
hello-python-6c7b478cf5-qsqvt   1/1     Running   0          2m53s
 app git:(master) ✗
</code></pre>
<p>But when I go to <code>localhost:6000</code> I get an error:</p>
<blockquote>
<p>This site can’t be reached. The web page at http://localhost:6000/ might be temporarily down or it may have moved permanently to a new web address.
ERR_UNSAFE_PORT</p>
</blockquote>
<p>When I do lsof -i tcp:6000 I get this:</p>
<pre><code>
COMMAND     PID        USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
com.docke 98546     &lt;me&gt;   76u  IPv6 0xc52e947a7a450f69      0t0  TCP *:6000 (LISTEN)

</code></pre>
<p>Is this a bug in the tutorial, or am I doing something wrong?</p>

nz_21
<h2>Docker Desktop</h2>
<p>I checked if it works and I have the same issue.</p>
<p><strong>EDIT</strong></p>
<p>As @Boris the Spider mentioned in comments</p>
<blockquote>
<p>Port 6000 is <a href="https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc" rel="nofollow noreferrer">blocked by chrome</a> for safety - it’s the X11 port and I think Chrome is trying to prevent certain kinds of XSS attacks. You can <a href="https://superuser.com/questions/188006/how-to-fix-err-unsafe-port-error-on-chrome-when-browsing-to-unsafe-ports">disable</a> this protection by passing flags to chrome.</p>
</blockquote>
<p>If you don't want to change chrome settings you change the port of the service. For example from 6000 to 8000.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: hello-python-service
spec:
  selector:
    app: hello-python
  ports:
  - protocol: &quot;TCP&quot;
    port: 8000   &lt;---
    targetPort: 5000
  type: LoadBalancer
</code></pre>
<p>if you change it to 8000 then use localhost:8000 instead and it works.</p>
<p><a href="https://i.stack.imgur.com/FBGez.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FBGez.png" alt="enter image description here" /></a></p>
<hr />
<h2>Minikube</h2>
<p>Minikube doesn't supports LB external IP.</p>
<blockquote>
<p>On cloud providers that support load balancers, an external IP address would be provisioned to access the Service. On minikube, the LoadBalancer type makes the Service accessible through the minikube service command.</p>
</blockquote>
<p>So if you use minikube try with <code>minikube service</code> instead.</p>
<p>There is related <a href="https://kubernetes.io/docs/tutorials/hello-minikube/#create-a-service" rel="nofollow noreferrer">documentation</a> with an example.</p>
