Skip to content

KubeRay Operator Installation and Management

Deploying the KubeRay Operator

Deploy the KubeRay operator in the ray namespace using the Helm chart repository. If you don’t have helm installed, install Helm first.

Terminal window
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
helm repo update

Update the values.yaml to override the default settings. For example, update the requests section:

requests:
cpu: 100m
memory: 512Mi

If this is a new installation, install both the CRDs and the KubeRay operator:

Terminal window
helm install kuberay-operator kuberay/kuberay-operator -f values.yaml -n ray

If this is an upgrade to an existing installation, use the following command to upgrade:

Terminal window
helm upgrade --install kuberay-operator kuberay/kuberay-operator -f values.yaml -n ray

To confirm that the operator is running, check the pods:

Terminal window
kubectl get pods

A kuberay-operator- pod should appear, as shown below:

Terminal window
# NAME READY STATUS RESTARTS AGE
# kuberay-operator-5bc8dbcfb-wddp8 1/1 Running 3 (130m ago) 138m

Allow Other Namespaces to Create Ray Resources

To allow other namespaces to create Ray resources, run kubectl edit clusterrole kubeless-user and add the following section:

- apiGroups:
- ray.io
resources:
- rayjobs
- rayservices
- rayclusters
verbs:
- list
- watch
- get
- update
- delete

Cleaning Up KubeRay Operator

To uninstall the KubeRay Operator, run the following command:

Terminal window
helm uninstall kuberay-operator
# release "kuberay-operator" uninstalled

It may take a few seconds for the KubeRay Operator pod to terminate. Confirm that the pods are gone by running:

Terminal window
kubectl get pods