Skip to content

Commit

Permalink
feat: adjustable deployment strategy (#118)
Browse files Browse the repository at this point in the history
* feat: adjustable deployment strategy

* chore: bump up chart version to 0.0.5

Signed-off-by: BrianPark314 <[email protected]>
  • Loading branch information
BrianPark314 authored Feb 13, 2025
1 parent 82d2401 commit 748481e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.4
version: 0.0.5

maintainers:
- name: apostac
26 changes: 24 additions & 2 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,36 @@ Define container port name
{{- end }}

{{/*
Define deployment strategy
Define engine deployment strategy.
If .Values.engineStrategy is defined, use it.
Otherwise, fall back to the default rolling update strategy.
*/}}
{{- define "chart.strategy" -}}
{{- define "chart.engineStrategy" -}}
{{- if .Values.servingEngineSpec.strategy }}
{{ toYaml .Values.servingEngineSpec.strategy | nindent 2 }}
{{- else }}
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
{{- end }}
{{- end }}

{{/*
Define router deployment strategy.
If .Values.routerStrategy is defined, use it.
Otherwise, fall back to the default rolling update strategy.
*/}}
{{- define "chart.routerStrategy" -}}
{{- if .Values.routerSpec.strategy }}
{{ toYaml .Values.routerSpec.strategy | nindent 2 }}
{{- else }}
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
{{- end }}
{{- end }}

{{/*
Define additional ports
Expand Down
3 changes: 2 additions & 1 deletion helm/templates/deployment-router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
labels:
{{- include "chart.routerLabels" . | nindent 4 }}
spec:
replicas: 1
replicas: {{ .Values.routerSpec.replicaCount }}
{{- include "chart.routerStrategy" . | nindent 2 }}
selector:
matchLabels:
{{- include "chart.routerLabels" . | nindent 6 }}
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/deployment-vllm-multi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- include "chart.engineLabels" . | nindent 4 }}
spec:
replicas: {{ $modelSpec.replicaCount }}
{{- include "chart.strategy" . | nindent 2 }}
{{- include "chart.engineStrategy" . | nindent 2 }}
selector:
matchLabels:
{{- include "chart.engineLabels" . | nindent 6 }}
Expand Down
6 changes: 6 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ servingEngineSpec:
# -- Set other environment variables from config map
configs: {}

# -- deployment strategy
strategy: {}

# -- Readiness probe configuration
startupProbe:
# -- Number of seconds after the container has started before startup probe is initiated
Expand Down Expand Up @@ -171,6 +174,9 @@ routerSpec:
# -- Window size in seconds to calculate the request statistics
requestStatsWindow: 60

# -- deployment strategy
strategy: {}

# -- router resource requests and limits
resources:
requests:
Expand Down

0 comments on commit 748481e

Please sign in to comment.