Skip to content

Commit

Permalink
[Feat] Enable static service discovery on router through Helm (#111)
Browse files Browse the repository at this point in the history
* Feature: Enable static service discovery on router

* fix: Leave new values' defaults blank

Signed-off-by: 0xThresh.eth <[email protected]>
  • Loading branch information
0xThresh authored Feb 13, 2025
1 parent 49f442f commit 82d2401
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions helm/templates/deployment-router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,25 @@ spec:
containers:
- name: router-container
image: lmcache/lmstack-router:latest
args: # TODO: update here
args:
- "--host"
- "0.0.0.0"
- "--port"
- "{{ .Values.routerSpec.containerPort }}"
- "--service-discovery"
- "k8s"
- "{{ default "k8s" .Values.routerSpec.serviceDiscovery }}"
{{- if eq .Values.routerSpec.serviceDiscovery "k8s" }}
- "--k8s-namespace"
- "{{ .Release.Namespace }}"
- "--k8s-label-selector"
- {{ include "labels.toCommaSeparatedList" .Values.servingEngineSpec.labels }}
{{- end }}
{{- if eq .Values.routerSpec.serviceDiscovery "static" }}
- "--static-backends"
- "{{ required "When using static service discovery, .Values.routerSpec.staticBackends is a required value" .Values.routerSpec.staticBackends }}"
- "--static-models"
- "{{ required "When using static service discovery, .Values.routerSpec.staticModels is a required value" .Values.routerSpec.staticModels }}"
{{- end }}
- "--routing-logic"
- "{{ .Values.routerSpec.routingLogic }}"
{{- if .Values.routerSpec.sessionKey }}
Expand Down
7 changes: 7 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ routerSpec:
# -- Service port
servicePort: 80

# -- Service discovery mode, supports "k8s" or "static". Defaults to "k8s" if not set.
serviceDiscovery: "k8s"

# -- If serviceDiscovery is set to "static", the comma-separated values below are required. There needs to be the same number of backends and models
staticBackends: ""
staticModels: ""

# -- routing logic, could be "roundrobin" or "session"
routingLogic: "roundrobin"

Expand Down

0 comments on commit 82d2401

Please sign in to comment.