How to distribute requests to pods on a Kubernetes service

admin

Administrator
Staff member
I have a service and 4 pods which wordpress installed on each. This is my service configuration:

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

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
).
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.

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