<p>When I set a nginx deployment (replica=1) and a service (nodeport) for nginx, I can access the service (http) from any other pod via CLUSTER-IP, but I cannot access the service in the nginx pod itself.
Is there any reason for this limitation?</p>

<p>The steps to simulate this kind of behavior:</p>

<p>1) Create the nginx deployment</p>

<pre><code>kubectl create deployment nginx --image=helioay/nginx
</code></pre>

<p>2) Create the service (nodeport)</p>

<pre><code>kubectl create service nodeport nginx --tcp=80:80
</code></pre>

<p>3) Check the pod and service</p>

<pre><code>[helio@kub-1 nginx]$ kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
nginx-67f769c566-jfhxl   1/1     Running   0          22m

[helio@kub-1 nginx]$ kubectl get services
NAME         TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
kubernetes   ClusterIP   10.43.0.1     &lt;none&gt;        443/TCP        45h
nginx        NodePort    10.43.3.216   &lt;none&gt;        80:31790/TCP   20m
</code></pre>

<p>4) Run another container/pod with Centos and I can see that I can access nginx calling the CLUSTER-IP defined by service:</p>

<pre><code>[helio@kub-1 nginx]$ kubectl run -it --rm --image=centos -- bash
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
If you don't see a command prompt, try pressing enter.
[root@bash-5d65698d48-klgvz /]# curl nginx
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Welcome to nginx!&lt;/title&gt;
&lt;style&gt;
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;
&lt;p&gt;If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.&lt;/p&gt;

&lt;p&gt;For online documentation and support please refer to
&lt;a href="http://nginx.org/"&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;
Commercial support is available at
&lt;a href="http://nginx.com/"&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>5) Connecting to nginx pod and calling (curl) nginx via CLUSTER-IP... <strong>no response</strong>:</p>

<pre><code>[helio@kub-1 nginx]$ kubectl get pods
NAME                     READY   STATUS    RESTARTS   AGE
nginx-67f769c566-jfhxl   1/1     Running   0          25m
[tecnotree@kub-1 nginx]$ kubectl exec -it nginx-67f769c566-jfhxl /bin/bash
root@nginx-67f769c566-jfhxl:/# curl nginx

^C
root@nginx-67f769c566-jfhxl:/# curl 10.43.3.216

^C

</code></pre>

<p>==> It´s possible to see that DNS is resolving the nginx name, but somehow it cannot actually reach nginx application.</p>

<p>I have tried to use NodePort and ClusterIP service configuration, but always same behavior.</p>

<p>I would expect that I could access the CLUSTER-IP from any POD in the kubernet cluster.... is there any special reason for this behavior or a way to get this working?</p>

Helio Aymoto
<p>This is the standard behaviour.</p>
<p>In minikube you can solve the issue running:</p>
<pre><code>minikube ssh
sudo ip link set docker0 promisc on
</code></pre>
<p>There are several issues opened/closed</p>
<ul>
<li><a href="https://github.com/kubernetes/kubernetes/issues/61593" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/61593</a></li>
<li><a href="https://github.com/kubernetes/minikube/issues/1568" rel="nofollow noreferrer">https://github.com/kubernetes/minikube/issues/1568</a></li>
<li><a href="https://github.com/kubernetes/kubernetes/issues/20475" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/20475</a></li>
</ul>
<p>The whole behaviour is quite obscure</p>
