Rework servers load-balancer to use the WRR

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
Julien Salleyron 2022-11-16 11:38:07 +01:00 committed by GitHub
parent 67d9c8da0b
commit fadee5e87b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 2085 additions and 2211 deletions

View file

@ -3,9 +3,11 @@ package gateway
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v2/pkg/config/dynamic"
"github.com/traefik/traefik/v2/pkg/provider"
"github.com/traefik/traefik/v2/pkg/tls"
@ -552,6 +554,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -642,6 +647,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -698,6 +706,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -762,6 +773,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -817,6 +831,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -872,6 +889,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -942,6 +962,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"default-whoami2-8080": {
@ -955,6 +978,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1014,6 +1040,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"default-whoami2-8080": {
@ -1027,6 +1056,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1103,6 +1135,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1188,6 +1223,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1267,6 +1305,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1322,6 +1363,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1392,6 +1436,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"bar-whoami-bar-80": {
@ -1405,6 +1452,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -1460,6 +1510,9 @@ func TestLoadHTTPRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -3548,6 +3601,9 @@ func TestLoadMixedRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -3722,6 +3778,9 @@ func TestLoadMixedRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},
@ -3923,6 +3982,9 @@ func TestLoadMixedRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"bar-whoami-bar-80": {
@ -3936,6 +3998,9 @@ func TestLoadMixedRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"bar-http-app-bar-my-gateway-web-a431b128267aabc954fd-wrr": {
@ -4083,6 +4148,9 @@ func TestLoadMixedRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
"bar-http-app-bar-my-gateway-web-a431b128267aabc954fd-wrr": {
@ -4231,6 +4299,9 @@ func TestLoadMixedRoutes(t *testing.T) {
},
},
PassHostHeader: pointer.Bool(true),
ResponseForwarding: &dynamic.ResponseForwarding{
FlushInterval: ptypes.Duration(100 * time.Millisecond),
},
},
},
},