Merge branch v3.0 into master
This commit is contained in:
commit
7fdb1ff8af
77 changed files with 2210 additions and 673 deletions
|
@ -237,15 +237,6 @@ func (p *Provider) loadTCPServers(client Client, namespace string, svc traefikv1
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if svc.NativeLB {
|
||||
address, err := getNativeServiceAddress(*service, *svcPort)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("getting native Kubernetes Service address: %w", err)
|
||||
}
|
||||
|
||||
return []dynamic.TCPServer{{Address: address}}, nil
|
||||
}
|
||||
|
||||
var servers []dynamic.TCPServer
|
||||
|
||||
if service.Spec.Type == corev1.ServiceTypeNodePort && svc.NodePortLB {
|
||||
|
@ -280,6 +271,19 @@ func (p *Provider) loadTCPServers(client Client, namespace string, svc traefikv1
|
|||
Address: net.JoinHostPort(service.Spec.ExternalName, strconv.Itoa(int(svcPort.Port))),
|
||||
})
|
||||
} else {
|
||||
nativeLB := p.NativeLBByDefault
|
||||
if svc.NativeLB != nil {
|
||||
nativeLB = *svc.NativeLB
|
||||
}
|
||||
if nativeLB {
|
||||
address, err := getNativeServiceAddress(*service, *svcPort)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("getting native Kubernetes Service address: %w", err)
|
||||
}
|
||||
|
||||
return []dynamic.TCPServer{{Address: address}}, nil
|
||||
}
|
||||
|
||||
endpoints, endpointsExists, endpointsErr := client.GetEndpoints(namespace, svc.Name)
|
||||
if endpointsErr != nil {
|
||||
return nil, endpointsErr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue