forked from Ivasoft/traefik
rework loadbalancer support
This commit is contained in:
committed by
Traefiker Bot
parent
b143101f82
commit
518a37e776
@@ -187,8 +187,7 @@ func loadServers(client Client, namespace string, svc v1alpha1.Service) ([]confi
|
||||
var servers []config.Server
|
||||
if service.Spec.Type == corev1.ServiceTypeExternalName {
|
||||
servers = append(servers, config.Server{
|
||||
URL: fmt.Sprintf("http://%s:%d", service.Spec.ExternalName, portSpec.Port),
|
||||
Weight: 1,
|
||||
URL: fmt.Sprintf("http://%s:%d", service.Spec.ExternalName, portSpec.Port),
|
||||
})
|
||||
} else {
|
||||
endpoints, endpointsExists, endpointsErr := client.GetEndpoints(namespace, svc.Name)
|
||||
@@ -224,8 +223,7 @@ func loadServers(client Client, namespace string, svc v1alpha1.Service) ([]confi
|
||||
|
||||
for _, addr := range subset.Addresses {
|
||||
servers = append(servers, config.Server{
|
||||
URL: fmt.Sprintf("%s://%s:%d", protocol, addr.IP, port),
|
||||
Weight: 1,
|
||||
URL: fmt.Sprintf("%s://%s:%d", protocol, addr.IP, port),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -332,7 +330,6 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: allServers,
|
||||
// TODO: support other strategies.
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -50,15 +50,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -98,15 +95,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -140,15 +134,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -156,15 +147,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -192,23 +180,18 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.3:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.3:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.4:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.4:8080",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -294,15 +277,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -331,15 +311,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:80",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:80",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
@@ -367,15 +344,12 @@ func TestLoadIngressRoutes(t *testing.T) {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "https://10.10.0.5:443",
|
||||
Weight: 1,
|
||||
URL: "https://10.10.0.5:443",
|
||||
},
|
||||
{
|
||||
URL: "https://10.10.0.6:443",
|
||||
Weight: 1,
|
||||
URL: "https://10.10.0.6:443",
|
||||
},
|
||||
},
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -31,9 +31,8 @@ type TLS struct {
|
||||
|
||||
// Service defines an upstream to proxy traffic.
|
||||
type Service struct {
|
||||
Name string `json:"name"`
|
||||
Port int32 `json:"port"`
|
||||
// TODO Weight int `json:"weight,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Port int32 `json:"port"`
|
||||
HealthCheck *HealthCheck `json:"healthCheck,omitempty"`
|
||||
Strategy string `json:"strategy,omitempty"`
|
||||
}
|
||||
|
||||
@@ -195,8 +195,7 @@ func loadService(client Client, namespace string, backend v1beta1.IngressBackend
|
||||
|
||||
if service.Spec.Type == corev1.ServiceTypeExternalName {
|
||||
servers = append(servers, config.Server{
|
||||
URL: fmt.Sprintf("http://%s:%d", service.Spec.ExternalName, portSpec.Port),
|
||||
Weight: 1,
|
||||
URL: fmt.Sprintf("http://%s:%d", service.Spec.ExternalName, portSpec.Port),
|
||||
})
|
||||
} else {
|
||||
endpoints, endpointsExists, endpointsErr := client.GetEndpoints(namespace, backend.ServiceName)
|
||||
@@ -233,8 +232,7 @@ func loadService(client Client, namespace string, backend v1beta1.IngressBackend
|
||||
|
||||
for _, addr := range subset.Addresses {
|
||||
servers = append(servers, config.Server{
|
||||
URL: fmt.Sprintf("%s://%s:%d", protocol, addr.IP, port),
|
||||
Weight: 1,
|
||||
URL: fmt.Sprintf("%s://%s:%d", protocol, addr.IP, port),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -243,7 +241,6 @@ func loadService(client Client, namespace string, backend v1beta1.IngressBackend
|
||||
return &config.Service{
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: servers,
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
},
|
||||
}, nil
|
||||
|
||||
@@ -51,16 +51,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -88,16 +85,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -125,16 +119,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -158,16 +149,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -190,12 +178,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/example-com/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.11.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.11.0.1:80",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -223,16 +209,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -260,16 +243,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -297,16 +277,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -341,16 +318,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -389,32 +363,26 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"testing/service2/8082": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.2:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.2:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.2:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -461,16 +429,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"default-backend": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -494,16 +459,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8089",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8089",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -527,16 +489,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/tchouk": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8089",
|
||||
},
|
||||
{
|
||||
URL: "http://10.21.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.21.0.1:8089",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -560,16 +519,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/tchouk": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8089",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:8089",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -597,32 +553,26 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/tchouk": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8089",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:8089",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"testing/service1/carotte": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8090",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8090",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:8090",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:8090",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -650,32 +600,26 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/tchouk": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8089",
|
||||
},
|
||||
{
|
||||
URL: "http://10.10.0.2:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.2:8089",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"toto/service1/tchouk": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.11.0.1:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.11.0.1:8089",
|
||||
},
|
||||
{
|
||||
URL: "http://10.11.0.2:8089",
|
||||
Weight: 1,
|
||||
URL: "http://10.11.0.2:8089",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -721,12 +665,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/8080": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://traefik.wtf:8080",
|
||||
Weight: 1,
|
||||
URL: "http://traefik.wtf:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -750,12 +692,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/example-com/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.11.0.1:80",
|
||||
Weight: 1,
|
||||
URL: "http://10.11.0.1:80",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -787,16 +727,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/443": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:443",
|
||||
Weight: 1,
|
||||
URL: "https://10.10.0.1:443",
|
||||
},
|
||||
{
|
||||
URL: "https://10.21.0.1:443",
|
||||
Weight: 1,
|
||||
URL: "https://10.21.0.1:443",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -820,16 +757,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/8443": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:8443",
|
||||
Weight: 1,
|
||||
URL: "https://10.10.0.1:8443",
|
||||
},
|
||||
{
|
||||
URL: "https://10.21.0.1:8443",
|
||||
Weight: 1,
|
||||
URL: "https://10.21.0.1:8443",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -854,16 +788,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/8443": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "https://10.10.0.1:8443",
|
||||
Weight: 1,
|
||||
URL: "https://10.10.0.1:8443",
|
||||
},
|
||||
{
|
||||
URL: "https://10.21.0.1:8443",
|
||||
Weight: 1,
|
||||
URL: "https://10.21.0.1:8443",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -888,16 +819,13 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"default-backend": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.30.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.30.0.1:8080",
|
||||
},
|
||||
{
|
||||
URL: "http://10.41.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.41.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -921,12 +849,10 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
|
||||
Services: map[string]*config.Service{
|
||||
"testing/service1/80": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Method: "wrr",
|
||||
PassHostHeader: true,
|
||||
Servers: []config.Server{
|
||||
{
|
||||
URL: "http://10.10.0.1:8080",
|
||||
Weight: 1,
|
||||
URL: "http://10.10.0.1:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user