From 7de3ac0c31d42f7325eda91028795f3832c27d7a Mon Sep 17 00:00:00 2001 From: JacobSMoller Date: Mon, 2 Sep 2024 11:40:24 +0200 Subject: [PATCH 1/2] Allow setting the appProtocol on the serve Service --- ray-operator/controllers/ray/common/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ray-operator/controllers/ray/common/service.go b/ray-operator/controllers/ray/common/service.go index da00fbdeaf..d7883b9b44 100644 --- a/ray-operator/controllers/ray/common/service.go +++ b/ray-operator/controllers/ray/common/service.go @@ -248,7 +248,7 @@ func BuildServeService(ctx context.Context, rayService rayv1.RayService, rayClus ports := []corev1.ServicePort{} for _, port := range serveService.Spec.Ports { if port.Name == utils.ServingPortName { - svcPort := corev1.ServicePort{Name: port.Name, Port: port.Port} + svcPort := corev1.ServicePort{Name: port.Name, Port: port.Port, AppProtocol: port.AppProtocol} ports = append(ports, svcPort) break } From 4c9a1cdc8c68a4282ee45186e570427e280cdadb Mon Sep 17 00:00:00 2001 From: JacobSMoller Date: Mon, 2 Sep 2024 12:29:41 +0200 Subject: [PATCH 2/2] Use default appProtocol if not specified --- ray-operator/controllers/ray/common/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ray-operator/controllers/ray/common/service.go b/ray-operator/controllers/ray/common/service.go index d7883b9b44..6b6e2e6bde 100644 --- a/ray-operator/controllers/ray/common/service.go +++ b/ray-operator/controllers/ray/common/service.go @@ -248,7 +248,11 @@ func BuildServeService(ctx context.Context, rayService rayv1.RayService, rayClus ports := []corev1.ServicePort{} for _, port := range serveService.Spec.Ports { if port.Name == utils.ServingPortName { - svcPort := corev1.ServicePort{Name: port.Name, Port: port.Port, AppProtocol: port.AppProtocol} + appProtocol := utils.DefaultServiceAppProtocol + if port.AppProtocol != nil { + appProtocol = *port.AppProtocol + } + svcPort := corev1.ServicePort{Name: port.Name, Port: port.Port, AppProtocol: &appProtocol} ports = append(ports, svcPort) break }