<p>My local kubernetes cluster is running by Rancher Desktop -</p>
<pre><code>% kubectl cluster-info

Kubernetes control plane is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/https:metrics-server:https/proxy
</code></pre>
<p>I have created a very basic job - to do a <code>telnet</code> at <code>localhost</code> and port <code>6443</code> and see if the connection is reachable by the job pod running in the cluster -&gt;</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: telnet-test
spec:
  template:
    spec:
      containers:
      - name: test-container
        image: getting-started:latest
        imagePullPolicy: IfNotPresent
        command: [&quot;/usr/bin/telnet&quot;]
        args: [&quot;127.0.0.1&quot;,&quot;6443&quot;]
      restartPolicy: Never
  backoffLimit: 4
</code></pre>
<p>Docker image is also basic , installing <code>telnet</code>  -&gt;</p>
<pre><code>#Download base image ubuntu 16.04
FROM ubuntu:16.04

# Update Software repository
RUN apt update &amp;&amp; apt upgrade

# Install nginx, php-fpm and supervisord from ubuntu repository
RUN apt install -y telnet

CMD [&quot;which&quot;,&quot;telnet&quot;]

EXPOSE 6443
</code></pre>
<p>When I run this job , I get connection refused -&gt;</p>
<pre><code>telnet: Unable to connect to remote host: Connection refused
Trying 127.0.0.1...
</code></pre>
<p>Any idea what I could be missing here ?</p>

devcodes
<p>&quot;kubectl cluster-info&quot; shows you on which NODE and port your Kubernetes api-server is Running. So these are processes running on either a virtual machine or on a physical machine.</p>
<p>IP address 127.0.0.1 is also known as the localhost address, and belong to the local network adapter. Hence it is NOT a real IP that you can call from any other machine.</p>
<p>When you test 127.0.0.1:6443 inside your container image running as a Pod or with &quot;docker run&quot;, you are not trying to call the NODE on port 6443. Instead you are trying to call the localhost address on port 6443 INSIDE the container.</p>
<p>When you install Kubernetes, it would be better if you configure the cluster address as the :6443 or :6443 instead of using a localhost address.</p>
