Skip to content

Commit

Permalink
[Doc] [KubeRay] Add GKE ingress doc (ray-project#38935)
Browse files Browse the repository at this point in the history
Adds a doc section for setting up Ingress on GKE. At the end of the doc, the user will be able to view the Ray dashboard UI via the Ingress.

---------

Signed-off-by: Archit Kulkarni <architkulkarni@users.noreply.github.com>
Co-authored-by: angelinalg <122562471+angelinalg@users.noreply.github.com>
Co-authored-by: Kai-Hsun Chen <kaihsun@apache.org>
  • Loading branch information
3 people authored and LeonLuttenberger committed Sep 5, 2023
1 parent e851f6e commit 612255e
Showing 1 changed file with 66 additions and 1 deletion.
67 changes: 66 additions & 1 deletion doc/source/cluster/kubernetes/k8s-ecosystem/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
Two examples show how to use ingress to access your Ray cluster:

* [AWS Application Load Balancer (ALB) Ingress support on AWS EKS](kuberay-aws-alb)
* [GKE Ingress support](kuberay-gke-ingress)
* [Manually setting up NGINX Ingress on Kind](kuberay-nginx)

(kuberay-aws-alb)=
## AWS Application Load Balancer (ALB) Ingress support on AWS EKS

### Prerequisite
### Prerequisites
* Create an EKS cluster. See [Getting started with Amazon EKS – AWS Management Console and AWS CLI](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html#eks-configure-kubectl).

* Set up the [AWS Load Balancer controller](https://github.com/kubernetes-sigs/aws-load-balancer-controller), see [installation instructions](https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/installation/). Note that the repository maintains a webpage for each release. Confirm that you are using the latest installation instructions.
Expand Down Expand Up @@ -72,6 +73,70 @@ kubectl describe ingress ray-cluster-ingress
kubectl delete ingress ray-cluster-ingress
```

(kuberay-gke-ingress)=

## GKE Ingress support

### Prerequisites

* Create a GKE cluster and ensure that you have the kubectl tool installed and authenticated to communicate with your GKE cluster. See [this tutorial](kuberay-gke-gpu-cluster-setup) for an example of how to create a GKE cluster with GPUs. (GPUs are not necessary for this section.)

* It may be helpful to understand the concepts at <https://cloud.google.com/kubernetes-engine/docs/concepts/ingress>.

### Instructions
Save the following file as `ray-cluster-gclb-ingress.yaml`:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ray-cluster-ingress
annotations:
kubernetes.io/ingress.class: "gce"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: raycluster-kuberay-head-svc # Update this line with your head service in Step 3 below.
port:
number: 8265
```

Now run the following commands:

```bash
# Step 1: Install KubeRay operator and CRD
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
helm install kuberay-operator kuberay/kuberay-operator --version 0.6.0

# Step 2: Install a RayCluster
helm install raycluster kuberay/ray-cluster --version 0.6.0

# Step 3: Edit ray-cluster-gclb-ingress.yaml to replace the service name with the name of the head service from the RayCluster. (Output of `kubectl get svc`)

# Step 4: Apply the Ingress configuration
kubectl apply -f ray-cluster-gclb-ingress.yaml

# Step 5: Check ingress created by Step 4.
kubectl describe ingress ray-cluster-ingress

# Step 6: After a few minutes, GKE allocates an external IP for the ingress. Check it using:
kubectl get ingress ray-cluster-ingress

# Example output:
# NAME CLASS HOSTS ADDRESS PORTS AGE
# ray-cluster-ingress <none> * 34.160.82.156 80 54m

# Step 7: Check Ray Dashboard by visiting the allocated external IP in your browser. (In this example, it is 34.160.82.156)

# Step 8: Delete the ingress.
kubectl delete ingress ray-cluster-ingress
```

(kuberay-nginx)=
## Manually setting up NGINX Ingress on Kind

Expand Down

0 comments on commit 612255e

Please sign in to comment.