<p>I have a question regarding Kubernetes networking.</p>

<p>I know that in Docker swarm if I want to run difference containers on difference servers, I need to create an overlay network, and then all the containers (from all the servers) will be attached to this network and they can communicate with each other (for example, I can ping from container A to container B).</p>

<p>I guess that in Kubernetes there isn't an overlay network - but another solution. For example, I would like to create 2 linux containers on 2 servers (server 1: ubuntu, server 2: centos7), so how do the pods communicate with each other if there isn't an overlay network?</p>

<p>And another doubt - can I create a cluster which consists of windows and linux machines with kubernetes?I mean, a multi platform kubernetes which all the pods communicate with each other.</p>

<p>Thanks a lot!!</p>

Johnykp
<p>In kubernetes, pods communicate with each other through service. To access any pod within cluster, it must be exposed using clusterIP service. So if you created service before creating pods, you will have env variable for each available service within container. Using that you can ping or access services and in turn pods. </p>

<p>For example:
Suppose you have two pods U1 and C1 and those are exposed by service named U-SVC and C-SVC respectively.</p>

<p>So if you want to access C1 from U1, you will have C-SVC service env variables(C-SVC_SERVICE_HOST,C-SVC_SERVICE_PORT) within container which you can use for access.</p>

<p>Also if DNS server set for your cluster, you can access service without env varibles.</p>
