forked from dream-horizon-org/darwin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8s-setup.sh
More file actions
executable file
·50 lines (41 loc) · 2.21 KB
/
k8s-setup.sh
File metadata and controls
executable file
·50 lines (41 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
CLUSTER_NAME=$CLUSTER_NAME
KIND_CONFIG=$KIND_CONFIG
KUBECONFIG=$KUBECONFIG
if ! command -v kind &> /dev/null; then
echo "kind could not be found, installing it"
brew install kind || apt-get install kind
fi
export KUBECONFIG=$KUBECONFIG
# Install kuberay operator (using local registry image)
echo "🚀 Installing kuberay-operator..."
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.5.1 -n ray-system --create-namespace \
--set image.repository=localhost:5000/quay.io/kuberay/operator \
--set image.tag=v1.5.1
kubectl wait --for=condition=Available --timeout=120s deployment/kuberay-operator -n ray-system
echo "✅ kuberay-operator installed successfully"
# Install nginx-proxy-server (using local registry image)
echo "🚀 Installing nginx-proxy-server..."
helm upgrade --install nginx-proxy-server ./helm/nginx-proxy-server -n ray-system --create-namespace \
--set nginx.image.repository=localhost:5000/nginx \
--set nginx.image.tag=1.27.4
kubectl wait --for=condition=Available --timeout=120s deployment/nginx-proxy-server -n ray-system
echo "✅ nginx-proxy-server installed successfully"
# Install kube-prometheus-stack (using local registry image for grafana)
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm upgrade --install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--values ./helm/kube-prometheus-stack/values.yaml \
-n prometheus-system --create-namespace
kubectl apply -f ./helm/kube-prometheus-stack/prometheus-rbac.yaml
kubectl apply -f ./helm/kube-prometheus-stack/grafana_dashboards_configmap.yaml
# Create service account with RBAC permissions
echo "🚀 Creating service account..."
kubectl create namespace ray 2>/dev/null || echo "Namespace already exists"
kubectl create serviceaccount darwin-ds-role -n ray 2>/dev/null || echo "Service account already exists"
# Install PV Chart
helm upgrade --install pv-chart ./helm/pv-chart -n ray
# Setup for serve
kubectl create namespace serve 2>/dev/null || echo "Namespace already exists"
kubectl apply -f ./helm/serve/serve-rbac.yaml 2>/dev/null || echo "Serve RBAC already exists"