<p>I have 2 services in my cluster exposed as NodePort, and I have one Nginx Ingress Controller that routes the request to each of them depending on the request URL.</p>
<p>Here is my ingress definition file:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  tls:
  - hosts:
    - example.com
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: ServiceA
          servicePort: 80
        path: /serviceA/(.*)
      - backend:
          serviceName: ServiceB
          servicePort: 80
        path: /serviceB/(.*)
</code></pre>
<p><a href="https://i.stack.imgur.com/F6IHt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F6IHt.png" alt="enter image description here" /></a></p>
<p>I am wondering what needs to be done in order to have another <code>backend</code> entry in this definition that sends 50% of requests to Service A and 50% of requests to Service B?</p>

Benjamin
<p>Try something like this -</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: canary
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/canary: &quot;true&quot;
    nginx.ingress.kubernetes.io/canary-weight: &quot;50&quot;
spec:
  tls:
  - hosts:
    - example.com
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: ServiceA
          servicePort: 80
        path: /serviceA/(.*)
      - backend:
          serviceName: ServiceB
          servicePort: 80
        path: /serviceB/(.*)
</code></pre>
