Mapping ExternalNames to custom ports
This commit is contained in:
parent
5a1d2aa4b6
commit
c37b040217
2 changed files with 52 additions and 7 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue