Files
David XiaandGitHub 1f98479a16 [feat][operator] validate Ray resource metadata in webhook (#3831)
when the Ray resource is created or updated. For users who opt into installing
the webhooks, this validation makes the K8s API fail the resource creation or
update request immediately in a synchronous way that's more obvious.

We refactor the RayCluster webhook to use the same validation functions that
the RayCluster controller uses. We also add tests for RayJob and RayService webhooks.

Signed-off-by: David Xia <[email protected]>
2025-07-21 11:17:59 -07:00

67 lines
1.2 KiB
YAML

---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-ray-io-v1-raycluster
failurePolicy: Fail
name: vraycluster.kb.io
rules:
- apiGroups:
- ray.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- rayclusters
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-ray-io-v1-rayjob
failurePolicy: Fail
name: vrayjob.kb.io
rules:
- apiGroups:
- ray.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- rayjobs
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-ray-io-v1-rayservice
failurePolicy: Fail
name: vrayservice.kb.io
rules:
- apiGroups:
- ray.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- rayservices
sideEffects: None