Specify the ingress service port for internal hostname

Signed-off-by: Marco Vito Moscaritolo <mavimo@gmail.com>
This commit is contained in:
Marco Vito Moscaritolo 2019-11-10 16:33:09 +01:00 committed by Danny Navarro
parent cbba6fbf49
commit d36dfde03f

View File

@ -22,7 +22,7 @@ func ConvertToCaddyConfig(ings []*v1beta1.Ingress) (caddyhttp.RouteList, error)
for _, ing := range ings {
for _, rule := range ing.Spec.Rules {
for _, path := range rule.HTTP.Paths {
clusterHostName := fmt.Sprintf("%v.%v.svc.cluster.local", path.Backend.ServiceName, ing.Namespace)
clusterHostName := fmt.Sprintf("%v.%v.svc.cluster.local:%d", path.Backend.ServiceName, ing.Namespace, path.Backend.ServicePort.IntVal)
r := baseRoute(clusterHostName)
r.MatcherSets = caddyhttp.MatcherSets{