Skip to content

Commit

Permalink
Switch on executor enabled for service ports
Browse files Browse the repository at this point in the history
Signed-off-by: glindsell <[email protected]>
  • Loading branch information
glindsell authored and seldondev committed Jun 23, 2020
1 parent f597ec4 commit 69162b5
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions operator/controllers/seldondeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,22 @@ func createPredictorService(pSvcName string, seldonId string, p *machinelearning
},
}

if engine_http_port != 0 && len(psvc.Spec.Ports) == 0 {
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"})
}
if isExecutorEnabled(mlDep) {
if engine_http_port != 0 && len(psvc.Spec.Ports) == 0 {
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"})
}

if engine_grpc_port != 0 && len(psvc.Spec.Ports) < 2 {
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"})
if engine_grpc_port != 0 && len(psvc.Spec.Ports) < 2 {
psvc.Spec.Ports = append(psvc.Spec.Ports, corev1.ServicePort{Protocol: corev1.ProtocolTCP, Port: int32(engine_http_port), TargetPort: intstr.FromInt(engine_http_port), Name: "grpc"})
}
} else {
if engine_http_port != 0 && len(psvc.Spec.Ports) == 0 {
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"})
}

if engine_grpc_port != 0 && len(psvc.Spec.Ports) < 2 {
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"})
}
}

if GetEnv("AMBASSADOR_ENABLED", "false") == "true" {
Expand Down

0 comments on commit 69162b5

Please sign in to comment.