Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.22 KB

load-balance.md

File metadata and controls

48 lines (37 loc) · 1.22 KB

Load balancing between Services

Introduction

For Services that providing the same service (called Sub-Services), BFE Ingress Controller supports load balancing between them, based on weight configured for each Service.

Configuration

BFE Ingress Controller use Annotation to support load-balancing between multiple Sub-Services:

  • in annotations

    • configure weight for each Sub-Service.

    • define a Service name for the service they provided together:

      bfe.ingress.kubernetes.io/balance.weight: '{"service": {"sub-service1":80, "sub-service2":20}}'
  • in rules

    • set the serviceName of backend as the Service name in Annotation, and set the servicePort.

Example

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: tls-example-ingress
  annotations:
    kubernetes.io/ingress.class: bfe    
    bfe.ingress.kubernetes.io/balance.weight: '{"service": {"service1":80, "service2":20}}'
spec:
  tls:
  - hosts:
      - https-example.foo.com
    secretName: testsecret-tls
  rules:
  - host: https-example.foo.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          serviceName: service
          servicePort: 80