Skip to content

Commit 3704fbf

Browse files
committed
add debugging tips
1 parent 5565cbb commit 3704fbf

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,62 @@ oc label namespace <namespace> kueue.openshift.io/managed=true
124124
```
125125

126126
This label instructs the Kueue Operator that the namespace should be managed by its webhook admission controllers. As a result, any Kueue resources within that namespace will be properly validated and mutated.
127+
128+
### Debugging
129+
Run your changes against a cluster using `go run`
130+
131+
1. create a kind cluster:
132+
unset KUBECONFIG environment variable, the cluster access configuration is stored in ${HOME}/.kube/config
133+
```
134+
unset KUBECONFIG
135+
kind create cluster --name=kueue-debug
136+
```
137+
138+
You can use an existing cluster you have
139+
140+
2. create the namespace from where the operator will run:
141+
```
142+
export KUBECONFIG=${HOME}/.kube/config
143+
# make sure you are at the root of the kueue operator repo
144+
kubectl create -f deploy/01_namespace.yaml
145+
```
146+
147+
3. create the CRD
148+
```
149+
kubectl create -f deploy/crd/kueue-operator.crd.yaml
150+
```
151+
152+
4. install cert manager
153+
```
154+
helm install --repo https://charts.jetstack.io --version v1.16.3 --create-namespace --namespace cert-manager --wait --set crds.enabled=true cert-manager cert-manager
155+
```
156+
157+
4. create the custom resource
158+
```
159+
❯ kubectl create -f - <<EOF
160+
apiVersion: operator.openshift.io/v1alpha1
161+
kind: Kueue
162+
metadata:
163+
labels:
164+
app.kubernetes.io/name: kueue-operator
165+
app.kubernetes.io/managed-by: kustomize
166+
name: cluster
167+
namespace: openshift-kueue-operator
168+
spec:
169+
config:
170+
integrations:
171+
frameworks:
172+
- "BatchJob"
173+
EOF
174+
```
175+
176+
5. install monitoring CRD
177+
```
178+
kubectl create -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/refs/heads/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
179+
```
180+
181+
6. Run the operator
182+
```
183+
go run cmd/kueue-operator/main.go operator --kubeconfig=${HOME}/.kube/config --namespace=openshift-kueue-operator
184+
``
185+

0 commit comments

Comments
 (0)