diff --git a/helm/litellm/templates/backend/deployment.yaml b/helm/litellm/templates/backend/deployment.yaml index 7db14ad87a5..b807d0a0e06 100644 --- a/helm/litellm/templates/backend/deployment.yaml +++ b/helm/litellm/templates/backend/deployment.yaml @@ -50,6 +50,14 @@ spec: - name: backend image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.backend.image.pullPolicy }} + {{- with .Values.backend.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.backend.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.backend.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/helm/litellm/templates/gateway/deployment.yaml b/helm/litellm/templates/gateway/deployment.yaml index 987109e361e..2a6fa477043 100644 --- a/helm/litellm/templates/gateway/deployment.yaml +++ b/helm/litellm/templates/gateway/deployment.yaml @@ -46,6 +46,14 @@ spec: - name: gateway image: "{{ .Values.gateway.image.repository }}:{{ .Values.gateway.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.gateway.image.pullPolicy }} + {{- with .Values.gateway.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.gateway.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.gateway.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/helm/litellm/templates/ui/deployment.yaml b/helm/litellm/templates/ui/deployment.yaml index 394eea17451..a73dedb150a 100644 --- a/helm/litellm/templates/ui/deployment.yaml +++ b/helm/litellm/templates/ui/deployment.yaml @@ -45,6 +45,14 @@ spec: - name: ui image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.ui.image.pullPolicy }} + {{- with .Values.ui.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.ui.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.ui.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/helm/litellm/tests/command_args_tests.yaml b/helm/litellm/tests/command_args_tests.yaml new file mode 100644 index 00000000000..0e41694675a --- /dev/null +++ b/helm/litellm/tests/command_args_tests.yaml @@ -0,0 +1,89 @@ +suite: test container command and args overrides +templates: + - gateway/deployment.yaml + - gateway/configmap.yaml + - backend/deployment.yaml + - ui/deployment.yaml +values: + - ./values/required.yaml +tests: + - it: gateway omits command and args by default + template: gateway/deployment.yaml + asserts: + - isNull: + path: spec.template.spec.containers[0].command + - isNull: + path: spec.template.spec.containers[0].args + + - it: gateway renders command and args when set + template: gateway/deployment.yaml + set: + gateway.command: + - .venv/bin/granian + gateway.args: + - gateway.main:app + - --http + - auto + asserts: + - equal: + path: spec.template.spec.containers[0].command + value: + - .venv/bin/granian + - equal: + path: spec.template.spec.containers[0].args + value: + - gateway.main:app + - --http + - auto + + - it: backend omits command and args by default + template: backend/deployment.yaml + asserts: + - isNull: + path: spec.template.spec.containers[0].command + - isNull: + path: spec.template.spec.containers[0].args + + - it: backend renders command and args when set + template: backend/deployment.yaml + set: + backend.command: + - python + backend.args: + - -m + - litellm + asserts: + - equal: + path: spec.template.spec.containers[0].command + value: + - python + - equal: + path: spec.template.spec.containers[0].args + value: + - -m + - litellm + + - it: ui omits command and args by default + template: ui/deployment.yaml + asserts: + - isNull: + path: spec.template.spec.containers[0].command + - isNull: + path: spec.template.spec.containers[0].args + + - it: ui renders command and args when set + template: ui/deployment.yaml + set: + ui.command: + - node + ui.args: + - server.js + asserts: + - equal: + path: spec.template.spec.containers[0].command + value: + - node + - equal: + path: spec.template.spec.containers[0].args + value: + - server.js diff --git a/helm/litellm/values.yaml b/helm/litellm/values.yaml index cb37656cb77..a4a30c56ac6 100644 --- a/helm/litellm/values.yaml +++ b/helm/litellm/values.yaml @@ -371,6 +371,8 @@ gateway: repository: ghcr.io/berriai/litellm-gateway tag: "" # defaults to .Chart.AppVersion pullPolicy: IfNotPresent + command: [] + args: [] service: type: ClusterIP port: 4000 @@ -517,6 +519,8 @@ backend: repository: ghcr.io/berriai/litellm-backend tag: "" pullPolicy: IfNotPresent + command: [] + args: [] service: type: ClusterIP port: 4001 @@ -585,6 +589,8 @@ ui: repository: ghcr.io/berriai/litellm-ui tag: "" pullPolicy: IfNotPresent + command: [] + args: [] service: type: ClusterIP port: 3000