Closed andrewsykim closed 3 months ago
I tested this PR manually.
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
apiServer:
extraArgs:
v: "4"
deployment.yaml
(helm-chart/kuberay-operator/templates/deployment.yaml) to enable this feature.
{{- $argList = append $argList "--use-kubernetes-proxy" -}}
I0419 01:57:09.080550 1 httplog.go:132] "HTTP" verb="GET" URI="/api/v1/namespaces/default/services/rayjob-sample-raycluster-rxhpc-head-svc:dashboard/proxy/api/jobs/rayjob-sample-zcjbj" latency="4.394603ms" userAgent="kuberay-operator/nightly" audit-ID="db0c2d98-a5d0-479f-81f8-7e9d7e3dc38b" srcIP="10.244.0.5:47796" resp=200
thanks @kevin85421! I'll look into adding an e2e test as well
Why are these changes needed?
There are some cases where Kuberay may not be able to directly connect to a Ray head node. For example, there might be a NetworkPolicy disallowing ingress from all Pods or KubeRay is running on a network with no connectivity to Pods. This PR allows Kuberay to use the
services/proxy
subresource to proxy HTTP requests to the Ray head node. This allows Kuberay to make requests to the head node without every connecting to it directly.Here are some sample HTTP requests in apiserver from my testing using the proxy subresource:
Checks