Add support for configuring load balancing strategy

This commit is contained in:
Owen
2026-10-12 16:47:12 -04:00
parent cccc2d1200
commit b43709903d
12 changed files with 149 additions and 0 deletions
+6
View File
@@ -30,6 +30,7 @@ import { buildWildcardTls } from "./certResolver";
import { buildHostRule, appendPathMatch, computeRoutePriority } from "./rule";
import {
buildHttpLoadBalancerServers,
buildLoadBalancingStrategy,
buildStickySessionCookie,
buildTcpUdpLoadBalancerServers,
buildStickySessionIp
@@ -93,6 +94,7 @@ export async function getTraefikConfig(
domainId: resources.domainId,
enabled: resources.enabled,
stickySession: resources.stickySession,
loadBalancingStrategy: resources.loadBalancingStrategy,
tlsServerName: resources.tlsServerName,
setHostHeader: resources.setHostHeader,
enableProxy: resources.enableProxy,
@@ -222,6 +224,7 @@ export async function getTraefikConfig(
domainId: row.domainId,
enabled: row.enabled,
stickySession: row.stickySession,
loadBalancingStrategy: row.loadBalancingStrategy,
tlsServerName: row.tlsServerName,
setHostHeader: row.setHostHeader,
enableProxy: row.enableProxy,
@@ -458,6 +461,9 @@ export async function getTraefikConfig(
config_output.http.services![serviceName] = {
loadBalancer: {
servers: buildHttpLoadBalancerServers(targets),
...buildLoadBalancingStrategy(
resource.loadBalancingStrategy
),
...(resource.stickySession
? buildStickySessionCookie(resource.ssl)
: {})