Skip to content

Commit def3eb4

Browse files
committed
feat(service): Update service port names for istio support
Based off of our discussion [here](https://seldondev.slack.com/archives/C8Y9A8G0Y/p1594744362472100). The current port for grpc traffic is named `grpc` (very reasonably). Due to the new pattern of multiplexing http/grpc traffic on the http port, issues have popped up when trying to send grpc traffic to a service defined by the `seldon.io/svc-name` due to the istio sidecar determining the protocol and only allowing grpc traffic through (more info [here](https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/)). This fix changes the name of the grpc port from `grpc` to `http2` to allow for multiplexing of traffic when istio sidecars are used, while still maintaining the ability for istio grpc metrics to be generated (more info [here](https://istio.io/latest/docs/reference/config/policy-and-telemetry/metrics/#metrics)). Signed off by: Nick Groszewski <groszewn@gmail.com>
1 parent 3730769 commit def3eb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

operator/controllers/seldondeployment_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,15 @@ func createPredictorService(pSvcName string, seldonId string, p *machinelearning
632632
}
633633

634634
if engine_grpc_port != 0 && len(psvc.Spec.Ports) < 2 {
635-
psvc.Spec.Ports = append(psvc.Spec.Ports, corev1.ServicePort{Protocol: corev1.ProtocolTCP, Port: int32(engine_grpc_port), TargetPort: intstr.FromInt(engine_http_port), Name: "grpc"})
635+
psvc.Spec.Ports = append(psvc.Spec.Ports, corev1.ServicePort{Protocol: corev1.ProtocolTCP, Port: int32(engine_grpc_port), TargetPort: intstr.FromInt(engine_http_port), Name: "http2"})
636636
}
637637
} else {
638638
if engine_http_port != 0 && len(psvc.Spec.Ports) == 0 {
639639
psvc.Spec.Ports = append(psvc.Spec.Ports, corev1.ServicePort{Protocol: corev1.ProtocolTCP, Port: int32(engine_http_port), TargetPort: intstr.FromInt(engine_http_port), Name: "http"})
640640
}
641641

642642
if engine_grpc_port != 0 && len(psvc.Spec.Ports) < 2 {
643-
psvc.Spec.Ports = append(psvc.Spec.Ports, corev1.ServicePort{Protocol: corev1.ProtocolTCP, Port: int32(engine_grpc_port), TargetPort: intstr.FromInt(engine_grpc_port), Name: "grpc"})
643+
psvc.Spec.Ports = append(psvc.Spec.Ports, corev1.ServicePort{Protocol: corev1.ProtocolTCP, Port: int32(engine_grpc_port), TargetPort: intstr.FromInt(engine_grpc_port), Name: "http2"})
644644
}
645645
}
646646

0 commit comments

Comments
 (0)