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
+12
View File
@@ -63,6 +63,18 @@ export function buildHttpLoadBalancerServers(targets: TargetWithSite[]) {
);
}
/**
* Build the loadBalancer.strategy for an HTTP-mode resource. Traefik defaults
* to wrr when strategy is omitted, so only emit it for the non-default
* strategies to keep the generated config unchanged for existing resources.
*/
export function buildLoadBalancingStrategy(strategy: string | null) {
if (!strategy || strategy === "wrr") {
return {};
}
return { strategy };
}
export function buildStickySessionCookie(ssl: boolean | null) {
return {
sticky: {