I have a kubernetes ingress of class nginx
and two load balancers. Running on GKE v1.17.
Sample ingress yaml:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
kubernetes.io/ingress.class: "nginx"
# Enable client certificate authentication
nginx.ingress.kubernetes.io/auth-tls-verify-client: "on"
# Create the secret containing the trusted ca certificates
nginx.ingress.kubernetes.io/auth-tls-secret: "production/client-cert-secret"
# Specify the verification depth in the client certificates chain
nginx.ingress.kubernetes.io/auth-tls-verify-depth: "1"
# Automatically redirect http to https
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
# Use regex in paths
nginx.ingress.kubernetes.io/use-regex: "true"
# Allow larger request body
nginx.ingress.kubernetes.io/proxy-body-size: 30m
# For notifications we add the proxy headers
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
spec:
tls:
- hosts:
- my-domain.com
secretName: my-tls-certificate
rules:
- host: my-domain.com
http:
paths:
- path: /(.*)
backend:
serviceName: load-balancer-1
servicePort: 443
I wish to split the traffic reached to the ingress between the two load balancers. For example:
load-balancer-1
will receive 90% of the traffic
load-balancer-2
will receive 10% of the traffic
How can I do that with kubernetes ingress?