Skip to content

Commit e02751a

Browse files
[Chore] Run operator outside the cluster (#2090)
1 parent 6186a7d commit e02751a

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

ray-operator/DEVELOPMENT.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ make clean
5959

6060
### End-to-end local development process on Kind
6161

62+
#### Run the operator inside the cluster
63+
6264
```bash
6365
# Step 1: Create a Kind cluster
6466
kind create cluster --image=kindest/node:v1.24.0
@@ -97,6 +99,24 @@ kubectl logs {YOUR_OPERATOR_POD} | grep "Hello KubeRay"
9799
* The command `make docker-build` (Step 3) will also run `make test` (unit tests).
98100
* Step 6 also installs the custom resource definitions (CRDs) used by the KubeRay operator.
99101

102+
#### Run the operator outside the cluster
103+
104+
> Note: Running the operator outside the cluster allows you to debug the operator using your IDE. For example, you can set breakpoints in the code and inspect the state of the operator.
105+
106+
```bash
107+
# Step 1: Create a Kind cluster
108+
kind create cluster --image=kindest/node:v1.24.0
109+
110+
# Step 2: Install CRDs
111+
make -C ray-operator install
112+
113+
# Step 3: Compile the source code
114+
make -C ray-operator build
115+
116+
# Step 4: Run the KubeRay operator
117+
./ray-operator/bin/manager -leader-election-namespace default -use-kubernetes-proxy
118+
```
119+
100120
### Running the tests
101121

102122
The unit tests can be run by executing the following command:

ray-operator/test/support/test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import (
99
"testing"
1010
"time"
1111

12-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13-
1412
"github.com/onsi/gomega"
13+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1514

1615
corev1 "k8s.io/api/core/v1"
1716
)
@@ -136,7 +135,6 @@ func (t *T) StreamKubeRayOperatorLogs() {
136135
LabelSelector: "app.kubernetes.io/component=kuberay-operator",
137136
})
138137
t.Expect(err).ShouldNot(gomega.HaveOccurred())
139-
t.Expect(pods.Items).ShouldNot(gomega.BeEmpty())
140138
now := metav1.NewTime(time.Now())
141139
for _, pod := range pods.Items {
142140
go func(pod corev1.Pod, ts *metav1.Time) {

0 commit comments

Comments
 (0)