跑RayJob遇到的问题1:spec.type: Unsupported value: “headService“”

基于KubeRay提交RayJob

0.背景

基于kuberay-operator 0.4.0版本

1.问题

提交作业

 kubectl apply -f ray_v1alpha1_rayjob.yaml

问题报错:

2023-05-10T07:43:56.288Z        INFO    controllers.RayCluster  reconciling RayCluster  {"cluster name": "rayjob-sample-raycluster-8l688"}
2023-05-10T07:43:56.304Z        ERROR   controllers.RayCluster  Pod Service create error!       {"Pod.Service.Error": "Service \"rayjob-sample-raycluster-8l688-head-svc\" is invalid: spec.type: Unsupported value: \"headService\": supported values: \"ClusterIP\", \"ExternalName\", \"LoadBalancer\", \"NodePort\"", "error": "Service \"rayjob-sample-raycluster-8l688-head-svc\" is invalid: spec.type: Unsupported value: \"headService\": supported values: \"ClusterIP\", \"ExternalName\", \"LoadBalancer\", \"NodePort\""}
github.com/ray-project/kuberay/ray-operator/controllers/ray.(*RayClusterReconciler).reconcileServices
        /workspace/controllers/ray/raycluster_controller.go:331
github.com/ray-project/kuberay/ray-operator/controllers/ray.(*RayClusterReconciler).rayClusterReconcile
        /workspace/controllers/ray/raycluster_controller.go:203
github.com/ray-project/kuberay/ray-operator/controllers/ray.(*RayClusterReconciler).Reconcile
        /workspace/controllers/ray/raycluster_controller.go:102
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:114
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:227
2023-05-10T07:43:56.310Z        ERROR   controller.raycluster-controller        Reconciler error        {"reconciler group": "ray.io", "reconciler kind": "RayCluster", "name": "rayjob-sample-raycluster-8l688", "namespace": "default", "error": "Service \"rayjob-sample-raycluster-8l688-head-svc\" is invalid: spec.type: Unsupported value: \"headService\": supported values: \"ClusterIP\", \"ExternalName\", \"LoadBalancer\", \"NodePort\""}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.1/pkg/internal/controller/controller.go:227

2.分析

job的yaml中没指定serviceType

3.解决方案

指定serviceType,可选值有

\"headService\": supported values: \"ClusterIP\", \"ExternalName\", \"LoadBalancer\", \"NodePort\""

在job的yaml中使用clusterIP:
在这里插入图片描述
再次提交就成功了

root@DESKTOP-3813A3M:/mnt/d/all/app/Ray/rayjob# kubectl apply -f ray_v1alpha1_rayjob.yaml
rayjob.ray.io/rayjob-sample created
configmap/ray-job-code-sample created
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值