Change Load Balancing Algorithm used by Gateway

Hello, the docs for Kong Ingress Controller mention:

The Kubernetes Ingress Controller does not use Services to route traffic to the pods. Instead, it uses the Endpoints API to bypass kube-proxy to allow Kong features like session affinity and custom load balancing algorithms.

In the documentation for Kong Gateway, I found that several load balancing algorithms are supported. Though it seems that an Upstream is required to configure the used algorithm (which I am not sure is available in a K8s environment).

Now, I’m not sure if it isn’t documented, or I just can’t find it. But I’m wondering if/how a custom load balancing algorithm can be configured for the Kong Ingress Controller?

The controller creates upstreams automatically for all Services. You can tune its parameters by attaching a KongIngress resource with an override annotation. For example:

kind: KongIngress
  name: configuration-demo
  algorithm: least-connections
apiVersion: v1
kind: Service
    app: echo
  annotations: configuration-demo
  name: echo
  - port: 8080
    name: high
    protocol: TCP
    targetPort: 8080