<p>I'm trying to solve gRPC load balance problem with linkerd, but requests will be evenly distributed only when all services are deployed on same node. If I deploy servers on different node, all request will be directed to one of them.</p>

<p><a href="https://i.stack.imgur.com/OYqNX.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/OYqNX.jpg</a></p>

<p>Both gRPC service and client are .Net application. Kubernetes version is v1.12.3. Linkerd version is stable-2.1.0.</p>

<p>Here is the configuration of my gRPC service:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: demogrpc-deploy
  name: demogrpc
spec:
  replicas: 3
  selector:
    matchLabels:
      app: demogrpc
  template:
    metadata:
      labels:
        app: demogrpc
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - topologyKey: kubernetes.io/hostname
            labelSelector:
              matchLabels:
                app: demogrpc
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: NoSchedule
      containers:
      - image: 192.168.99.25:30000/demogrpchost:1.0.9
        imagePullPolicy: Always
        name: demogrpc
        env:
        - name: GRPC_HOST
          value: "127.0.0.1"
        - name: SERVICE_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: GRPC_PORT
          value: "8000"
        ports:
        - containerPort: 8000
          name: grpc
      imagePullSecrets:
      - name: kubernetes-registry
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: demogrpc
  name: demogrpc
spec:
  clusterIP: None
  ports:
  - port: 8000
    targetPort: 8000
  selector:
    app: demogrpc
</code></pre>

<p>How do I make load balance work when services are deployed on different nodes?</p>

<hr>

<p>Update:</p>

<p>I inject linkerd to my client and it started to distribute requests now, but one of the service is still ignored by load balancer somehow.</p>

<hr>

<p>Update:</p>

<p>I scaled up the services to 5 and clients 3 and something interesting happened. All services receive requests now but for each clients, their requests are distributed to 4 of the services.</p>

<p><a href="https://i.stack.imgur.com/YGmQd.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/YGmQd.jpg</a></p>

Leisen Chang
<p>To configure <strong>Linkerd</strong> service mesh, each node will have a Linkerd. There will be no <code>service-to-service</code> direct communication across the nodes, only <strong>Linkerd</strong> is allowed to talk to another Linkerd. And Linkerd will communicate with services which are created in same node.</p>

<p>In your case, you Kubernetes service will talk to <strong>Linkerd</strong>, then Linkerd will distribute its request to all other Linkerd. This is how requests are distributed across nodes. Then upstream Linkerd will distributed requests among services on its node.</p>

<p><a href="https://i.stack.imgur.com/F6dPi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F6dPi.png" alt="enter image description here"></a></p>

<p>To get more, please check this: <a href="https://medium.com/@aerokite/linkerd-as-a-service-mesh-for-your-application-in-kubernetes-cluster-f97adc9153cb" rel="nofollow noreferrer">linkerd-as-a-service-mesh</a></p>
