<p>I have a service and 4 pods which wordpress installed on each. This is my service configuration:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  ports:
  - port: 31001
    nodePort: 31001
    targetPort: apache
    protocol: TCP
  selector:
    app: wordpress
  type: NodePort
</code></pre>

<p>Now all traffic are distributed randomly by the service. I want to change it that work non-random (I think It's name was <code>round robin</code>).
I have read <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">the official document</a> but I don't understand it.</p>

<p>Is there any way to manage traffic respectively?
Could anybody please show me an example?</p>

<p>As @Meysam mentioned, Kubernetes service distributes the request to pods using &quot;round robin&quot; technology by default.</p>
<p>I would advise you (and all who will read this topic in the future) to read more information about <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Kubernetes Services</a> and <a href="http://blog.wercker.com/how-does-kubernetes-handle-load-balancing" rel="nofollow noreferrer">How does kubernetes handle load balancing</a>. It will shed a light on tons of questions.</p>
<blockquote>
<p>Kubernetes uses a feature called kube-proxy to handle the virtual IPs for services. Kubernetes allocates tasks to pods within a service by the round-robin method</p>
<p>With round-robin allocation, the system maintains a list of destinations. When a request comes in, it assigns the request to the next destination on the list, then permutes the list (either by simple rotation, or a more complex method), so the next request goes to the following destination on the list.</p>
</blockquote>
