<p>Precondition: the kubernetes cluster have 1 master and 2 worker. The cluster uses one CIDR for all nodes.
Question: how to configure network to pod on worker1 can communicate with pod on worker2?</p>

Thai Nguyen
<p>Kubernetes has its own service discovery and you can use define <code>service</code> for communicate. If you want to communicate or send request to <code>worker2</code> then you have to define a service for <code>worker2</code>. Suppose you have a worker <code>add-service</code> and you want to communicate with it, then you have to define a service for <code>add-service</code> worker like below</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: add-service
spec:
  selector:
    app: add
  ports:
    - port: 3000
      targetPort: add-service
</code></pre>

<p>Then from worker1 you can user <code>add-service</code> to communicate and kuberntes will use service discovery to find the exact worker. Here is a <strong>hackernoon</strong> detail <a href="https://hackernoon.com/how-to-develop-go-grpc-microservices-and-deploy-in-kubernates-5eace0425bf8" rel="nofollow noreferrer">article</a> about how to create pod, deployment, service and communicate with between them.</p>
