mirror of
https://github.com/containous/traefik.git
synced 2025-10-05 07:33:19 +03:00
Mapping ExternalNames to custom ports
This commit is contained in:
committed by
Traefiker Bot
parent
5a1d2aa4b6
commit
c37b040217
@@ -270,13 +270,16 @@ func (p *Provider) loadIngresses(k8sClient Client) (*types.Configuration, error)
|
||||
protocol := label.DefaultProtocol
|
||||
for _, port := range service.Spec.Ports {
|
||||
if equalPorts(port, pa.Backend.ServicePort) {
|
||||
if port.Port == 443 {
|
||||
if port.Port == 443 || strings.HasPrefix(port.Name, "https") {
|
||||
protocol = "https"
|
||||
}
|
||||
|
||||
if service.Spec.Type == "ExternalName" {
|
||||
url := protocol + "://" + service.Spec.ExternalName
|
||||
name := url
|
||||
if port.Port != 443 && port.Port != 80 {
|
||||
url = fmt.Sprintf("%s:%d", url, port.Port)
|
||||
}
|
||||
|
||||
templateObjects.Backends[baseName].Servers[name] = types.Server{
|
||||
URL: url,
|
||||
|
Reference in New Issue
Block a user