This commit is contained in:
Jakub Małek 2026-10-21 04:47:16 +00:00 • committed by GitHub
commit 91cfdb45ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 150 additions and 2 deletions

View file

@ -56,6 +56,9 @@ app.kubernetes.io/name: {{ include "litellm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" }}
{{- with .Values.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end -}}
{{/*

View file

@ -7,7 +7,14 @@ metadata:
name: {{ include "litellm.backend.fullname" . }}
labels:
{{- include "litellm.commonLabels" . | nindent 4 }}
{{- with .Values.backend.deploymentLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
app.kubernetes.io/component: backend
{{- with .Values.backend.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.backend.hpa.enabled) (not (kindIs "invalid" .Values.backend.replicaCount)) }}
replicas: {{ .Values.backend.replicaCount }}

View file

@ -5,7 +5,14 @@ metadata:
name: {{ include "litellm.gateway.fullname" . }}
labels:
{{- include "litellm.commonLabels" . | nindent 4 }}
{{- with .Values.gateway.deploymentLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
app.kubernetes.io/component: gateway
{{- with .Values.gateway.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.gateway.hpa.enabled) (not (kindIs "invalid" .Values.gateway.replicaCount)) }}
replicas: {{ .Values.gateway.replicaCount }}

View file

@ -15,8 +15,11 @@ metadata:
name: {{ include "litellm.fullname" . }}-migrations
labels:
{{- include "litellm.commonLabels" . | nindent 4 }}
{{- with .Values.migrationJob.jobLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
app.kubernetes.io/component: migrations
{{- if or .Values.migrationJob.hooks.helm.enabled .Values.migrationJob.hooks.argocd.enabled }}
{{- if or .Values.migrationJob.hooks.helm.enabled .Values.migrationJob.hooks.argocd.enabled .Values.migrationJob.jobAnnotations }}
annotations:
{{- if .Values.migrationJob.hooks.helm.enabled }}
helm.sh/hook: pre-install,pre-upgrade
@ -27,6 +30,9 @@ metadata:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- end }}
{{- with .Values.migrationJob.jobAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
backoffLimit: {{ .Values.migrationJob.backoffLimit }}

View file

@ -7,7 +7,14 @@ metadata:
name: {{ include "litellm.ui.fullname" . }}
labels:
{{- include "litellm.commonLabels" . | nindent 4 }}
{{- with .Values.ui.deploymentLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
app.kubernetes.io/component: ui
{{- with .Values.ui.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.ui.hpa.enabled) (not (kindIs "invalid" .Values.ui.replicaCount)) }}
replicas: {{ .Values.ui.replicaCount }}

View file

@ -170,3 +170,60 @@ tests:
value:
- name: nginx-config
mountPath: /etc/nginx/conf.d
- it: gateway deployment applies commonLabels, deploymentLabels and deploymentAnnotations
template: gateway/deployment.yaml
set:
commonLabels:
team: platform
gateway.deploymentLabels:
custom/label: gateway-label
gateway.deploymentAnnotations:
custom/annotation: gateway-annotation
asserts:
- isSubset:
path: metadata.labels
content:
team: platform
custom/label: gateway-label
- equal:
path: metadata.annotations["custom/annotation"]
value: gateway-annotation
- it: backend deployment applies commonLabels, deploymentLabels and deploymentAnnotations
template: backend/deployment.yaml
set:
commonLabels:
team: platform
backend.deploymentLabels:
custom/label: backend-label
backend.deploymentAnnotations:
custom/annotation: backend-annotation
asserts:
- isSubset:
path: metadata.labels
content:
team: platform
custom/label: backend-label
- equal:
path: metadata.annotations["custom/annotation"]
value: backend-annotation
- it: ui deployment applies commonLabels, deploymentLabels and deploymentAnnotations
template: ui/deployment.yaml
set:
commonLabels:
team: platform
ui.deploymentLabels:
custom/label: ui-label
ui.deploymentAnnotations:
custom/annotation: ui-annotation
asserts:
- isSubset:
path: metadata.labels
content:
team: platform
custom/label: ui-label
- equal:
path: metadata.annotations["custom/annotation"]
value: ui-annotation

View file

@ -213,3 +213,16 @@ tests:
name: RELEASE-NAME-litellm-ui
port:
number: 3000
- it: includes common labels in the ingress metadata
set:
commonLabels:
team: platform
foo: bar
ingress.enabled: true
asserts:
- isSubset:
path: metadata.labels
content:
team: platform
foo: bar

View file

@ -254,3 +254,35 @@ tests:
path: spec.template.spec.nodeSelector
- isNull:
path: spec.template.spec.tolerations
- it: applies commonLabels, jobLabels and jobAnnotations to the Job
set:
commonLabels:
team: platform
migrationJob.jobLabels:
custom/label: job-label
migrationJob.jobAnnotations:
custom/annotation: job-annotation
asserts:
- isSubset:
path: metadata.labels
content:
team: platform
custom/label: job-label
app.kubernetes.io/component: migrations
- equal:
path: metadata.annotations["custom/annotation"]
value: job-annotation
- it: keeps hook annotations alongside custom jobAnnotations
set:
migrationJob.hooks.helm.enabled: true
migrationJob.jobAnnotations:
custom/annotation: job-annotation
asserts:
- equal:
path: metadata.annotations["custom/annotation"]
value: job-annotation
- equal:
path: metadata.annotations["helm.sh/hook"]
value: pre-install,pre-upgrade

View file

@ -2,7 +2,7 @@
nameOverride: ""
fullnameOverride: ""
commonLabels: {}
imagePullSecrets: []
# Optional Ingress wiring the three component Services behind a single L7
@ -150,6 +150,10 @@ migrationJob:
# pod. Same shape as gateway.podSecurityContext / gateway.securityContext.
podSecurityContext: {}
securityContext: {}
# Extra labels on the Job itself.
jobLabels: {}
# Extra annotations on the Job itself.
jobAnnotations: {}
# Extra pod labels on the Job pod, merged into the chart's common labels.
podLabels: {}
# Additional volumes on the Job pod and volumeMounts on its container, e.g.
@ -465,6 +469,10 @@ gateway:
enabled: false
minAvailable: ""
maxUnavailable: ""
# Extra annotations on the gateway Deployment itself.
deploymentAnnotations: {}
# Extra labels on the gateway Deployment itself.
deploymentLabels: {}
podAnnotations: {}
# Extra pod labels, merged into the chart's selector labels. Do not
# re-declare `app.kubernetes.io/name` / `instance` / `component` here: they
@ -565,6 +573,10 @@ backend:
enabled: false
minAvailable: ""
maxUnavailable: ""
# Extra labels on the backend Deployment itself.
deploymentLabels: {}
# Extra annotations on the backend Deployment itself.
deploymentAnnotations: {}
podAnnotations: {}
# Same shape as the gateway blocks of the same name.
podLabels: {}
@ -634,6 +646,10 @@ ui:
enabled: false
minAvailable: ""
maxUnavailable: ""
# Extra labels on the ui Deployment itself.
deploymentLabels: {}
# Extra annotations on the ui Deployment itself.
deploymentAnnotations: {}
podAnnotations: {}
# Same shape as the gateway blocks of the same name. The nginx runtime
# writes its pid, cache, and proxy temp files under /tmp, so it boots as