Skip to content

Commit

Permalink
feat(helm): support isolated namespace for ray cluster (#1137)
Browse files Browse the repository at this point in the history
Because

- allow user to install `RayCluster` in separate namespace

This commit

- support separate namespace installation for `RayCluster`
  • Loading branch information
heiruwu authored Oct 21, 2024
1 parent 2c64694 commit 0d662e6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
repository: https://ray-project.github.io/kuberay-helm/
version: 1.1.1
tags:
- model
- ray
- name: elasticsearch
repository: https://helm.elastic.co
version: 7.17.3
Expand Down
28 changes: 25 additions & 3 deletions charts/core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ Allow the release namespace to be overridden for multi-namespace deployments in
{{- end -}}
{{- end -}}

{{/*
Ray fullname
*/}}
{{- define "ray.fullname" -}}
{{- if .Values.rayService.namespaceOverride -}}
{{- .Values.rayService.namespaceOverride -}}
{{- else -}}
{{- printf "%s" (include "core.name" .) -}}
{{- end -}}
{{- end -}}

{{/*
Inter namespace DNS suffix
*/}}
{{- define "ray.suffix" -}}
{{- if .Values.rayService.namespaceOverride -}}
{{- printf ".%s.svc.cluster.local" (include "ray.fullname" .) -}}
{{- else -}}
{{- printf "" -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down Expand Up @@ -243,15 +265,15 @@ temopral
{{- end -}}

{{- define "core.kuberay-operator" -}}
{{- printf "%s-kuberay-operator" (include "core.fullname" .) -}}
{{- printf "%s-kuberay-operator" (include "ray.fullname" .) -}}
{{- end -}}

{{- define "core.ray-service" -}}
{{- printf "%s-ray" (include "core.fullname" .) -}}
{{- printf "%s-ray" (include "ray.fullname" .) -}}
{{- end -}}

{{- define "core.ray" -}}
{{- printf "%s-ray-head-svc" (include "core.fullname" .) -}}
{{- printf "%s-ray-head-svc%s" (include "ray.fullname" .) (include "ray.suffix" .) -}}
{{- end -}}

{{- define "core.ray.clientPort" -}}
Expand Down
4 changes: 4 additions & 0 deletions charts/core/templates/model-backend/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ data:
replicationtimeframe: 1
{{- end }}
registry:
{{- if .Values.rayService.namespaceOverride }}
host: {{ include "core.registry" . }}.{{ include "core.namespace" . }}.svc.cluster.local
{{- else }}
host: {{ template "core.registry" . }}
{{- end }}
port: {{ template "core.registry.port" . }}
influxdb:
url: {{ .Values.influxdbCloud.url }}
Expand Down
2 changes: 1 addition & 1 deletion charts/core/templates/ray-service/monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tags.model -}}
{{- if .Values.tags.ray -}}
{{- if .Values.tags.prometheusStack }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
2 changes: 1 addition & 1 deletion charts/core/templates/ray-service/ray-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tags.model -}}
{{- if .Values.tags.ray -}}
apiVersion: ray.io/v1
kind: RayCluster
metadata:
Expand Down
2 changes: 2 additions & 0 deletions charts/core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ kuberay-operator:
- "instill-ai"
# -- The configuration of Ray
rayService:
namespaceOverride:
vram:
spec:
autoscalerOptions:
Expand Down Expand Up @@ -1641,6 +1642,7 @@ milvus:
pulsar:
namespace: instill-ai
tags:
ray: true
model: true
observability: false
prometheusStack: false
Expand Down

0 comments on commit 0d662e6

Please sign in to comment.