Skip to content

Commit 58c2aad

Browse files
authored
Add support for Ray token auth (#4179)
* Add support for Ray token auth Signed-off-by: Andrew Sy Kim <andrewsy@google.com> * add e2e test for Ray cluster auth Signed-off-by: Andrew Sy Kim <andrewsy@google.com> * address nits from Ruiean Signed-off-by: Andrew Sy Kim <andrewsy@google.com> * update RAY_auth_mode -> RAY_AUTH_MODE Signed-off-by: Andrew Sy Kim <andrewsy@google.com> * configure auth for Ray autoscaler Signed-off-by: Andrew Sy Kim <andrewsy@google.com> --------- Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
1 parent ac4c3c8 commit 58c2aad

File tree

22 files changed

+559
-0
lines changed

22 files changed

+559
-0
lines changed

docs/reference/api.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,35 @@ Package v1 contains API Schema definitions for the ray v1 API group
1616

1717

1818

19+
#### AuthMode
20+
21+
_Underlying type:_ _string_
22+
23+
AuthMode describes the authentication mode for the Ray cluster.
24+
25+
26+
27+
_Appears in:_
28+
- [AuthOptions](#authoptions)
29+
30+
31+
32+
#### AuthOptions
33+
34+
35+
36+
AuthOptions defines the authentication options for a RayCluster.
37+
38+
39+
40+
_Appears in:_
41+
- [RayClusterSpec](#rayclusterspec)
42+
43+
| Field | Description | Default | Validation |
44+
| --- | --- | --- | --- |
45+
| `mode` _[AuthMode](#authmode)_ | Mode specifies the authentication mode.<br />Supported values are "disabled" and "token".<br />Defaults to "token". | | Enum: [disabled token] <br /> |
46+
47+
1948
#### AutoscalerOptions
2049

2150

@@ -268,6 +297,7 @@ _Appears in:_
268297

269298
| Field | Description | Default | Validation |
270299
| --- | --- | --- | --- |
300+
| `authOptions` _[AuthOptions](#authoptions)_ | AuthOptions specifies the authentication options for the RayCluster. | | |
271301
| `suspend` _boolean_ | Suspend indicates whether a RayCluster should be suspended.<br />A suspended RayCluster will have head pods and worker pods deleted. | | |
272302
| `managedBy` _string_ | ManagedBy is an optional configuration for the controller or entity that manages a RayCluster.<br />The value must be either 'ray.io/kuberay-operator' or 'kueue.x-k8s.io/multikueue'.<br />The kuberay-operator reconciles a RayCluster which doesn't have this field at all or<br />the field value is the reserved string 'ray.io/kuberay-operator',<br />but delegates reconciling the RayCluster with 'kueue.x-k8s.io/multikueue' to the Kueue.<br />The field is immutable. | | |
273303
| `autoscalerOptions` _[AutoscalerOptions](#autoscaleroptions)_ | AutoscalerOptions specifies optional configuration for the Ray autoscaler. | | |

helm-chart/kuberay-operator/crds/ray.io_rayclusters.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm-chart/kuberay-operator/crds/ray.io_rayjobs.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm-chart/kuberay-operator/crds/ray.io_rayservices.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

helm-chart/kuberay-operator/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ rules:
169169
- pods/resize
170170
verbs:
171171
- patch
172+
- apiGroups:
173+
- ""
174+
resources:
175+
- secrets
176+
verbs:
177+
- create
178+
- get
179+
- list
180+
- patch
181+
- update
182+
- watch
172183
- apiGroups:
173184
- ""
174185
resources:

ray-operator/apis/ray/v1/raycluster_types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111

1212
// RayClusterSpec defines the desired state of RayCluster
1313
type RayClusterSpec struct {
14+
// AuthOptions specifies the authentication options for the RayCluster.
15+
// +optional
16+
AuthOptions *AuthOptions `json:"authOptions,omitempty"`
1417
// Suspend indicates whether a RayCluster should be suspended.
1518
// A suspended RayCluster will have head pods and worker pods deleted.
1619
// +optional
@@ -46,6 +49,26 @@ type RayClusterSpec struct {
4649
WorkerGroupSpecs []WorkerGroupSpec `json:"workerGroupSpecs,omitempty"`
4750
}
4851

52+
// AuthMode describes the authentication mode for the Ray cluster.
53+
type AuthMode string
54+
55+
const (
56+
// AuthModeDisabled disables authentication.
57+
AuthModeDisabled AuthMode = "disabled"
58+
// AuthModeToken enables token-based authentication.
59+
AuthModeToken AuthMode = "token"
60+
)
61+
62+
// AuthOptions defines the authentication options for a RayCluster.
63+
type AuthOptions struct {
64+
// Mode specifies the authentication mode.
65+
// Supported values are "disabled" and "token".
66+
// Defaults to "token".
67+
// +kubebuilder:validation:Enum=disabled;token
68+
// +optional
69+
Mode AuthMode `json:"mode,omitempty"`
70+
}
71+
4972
// GcsFaultToleranceOptions contains configs for GCS FT
5073
type GcsFaultToleranceOptions struct {
5174
// +optional

ray-operator/apis/ray/v1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/config/crd/bases/ray.io_rayclusters.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/config/crd/bases/ray.io_rayjobs.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ray-operator/config/crd/bases/ray.io_rayservices.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)