Skip to content

Commit 374cc82

Browse files
author
Tonio
committed
Support custom service name and port in ingress paths
Allow specifying serviceName and servicePort per path in ingress configuration. Handles both numeric and string port types for K8s versions with different backend formats.
1 parent f1fbae8 commit 374cc82

File tree

3 files changed

+475
-3
lines changed

3 files changed

+475
-3
lines changed

deploy/charts/litellm-helm/templates/ingress.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,20 @@ spec:
4949
backend:
5050
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
5151
service:
52-
name: {{ $fullName }}
52+
name: {{ hasKey . "serviceName" | ternary .serviceName $fullName }}
5353
port:
54+
{{- if hasKey . "servicePort" }}
55+
{{- if has (typeOf .servicePort) (list "int" "float64") }}
56+
number: {{ .servicePort }}
57+
{{- else }}
58+
name: {{ .servicePort }}
59+
{{- end }}
60+
{{- else }}
5461
number: {{ $svcPort }}
62+
{{- end }}
5563
{{- else }}
56-
serviceName: {{ $fullName }}
57-
servicePort: {{ $svcPort }}
64+
serviceName: {{ hasKey . "serviceName" | ternary .serviceName $fullName }}
65+
servicePort: {{ hasKey . "servicePort" | ternary .servicePort $svcPort }}
5866
{{- end }}
5967
{{- end }}
6068
{{- end }}

0 commit comments

Comments
 (0)