<p>I created a k8s cluster on vmwareworkstation (kubeadm) and now try on networkpolicy lab.</p>
<p>Here is my code:</p>
<pre><code># create new ns
    kubectl create ns demo 
# run new nginx pod 
    kubectl run nginx -n demo --image nginx 
# expose pod by clusterIP 
    kubectl expose po nginx --port=80 -n demo 
# run busybox to connect to nginx pod
    kubectl run busybox --image busybox -n default --rm -ti /bin/sh
    # busybox is not same namespace with nginx
    wget -q --timeout=5 nginx -O - # return timeout since two pods not in same namespace
    wget -q --timeout=5  -O -10.244.2.21 -O - # it works this time with IP of nginx pod. 
</code></pre>
<p>Can somebody explain me what is going on here ? is that everything right with my k8s cluster ?</p>
<p>Thank you so much!</p>

nam
<p>Turn out my problem come from coredns. re-install cluster again with calico plugin -&gt;  problem solved.</p>
<p>for the ans: by default, all pod connect to each other by IP not name. Only apply service (ClusterIP) let pod access to each other by service name (eg: Nginx)</p>
