From 8e2afc0865d572b136212b1bc0faee6d837d3bc1 Mon Sep 17 00:00:00 2001 From: namnt2307 Date: Mon, 10 Aug 2026 13:36:37 +0700 Subject: [PATCH] feat(helm): ui.listenIPv6 renders NGINX_LISTEN_IPV6 on the ui container --- helm/litellm/templates/ui/deployment.yaml | 4 +++ helm/litellm/tests/ui_listen_ipv6_tests.yaml | 33 ++++++++++++++++++++ helm/litellm/values.yaml | 5 +++ 3 files changed, 42 insertions(+) create mode 100644 helm/litellm/tests/ui_listen_ipv6_tests.yaml diff --git a/helm/litellm/templates/ui/deployment.yaml b/helm/litellm/templates/ui/deployment.yaml index b4129dbc8ac..ebd51d69f1c 100644 --- a/helm/litellm/templates/ui/deployment.yaml +++ b/helm/litellm/templates/ui/deployment.yaml @@ -53,6 +53,10 @@ spec: - name: LITELLM_BACKEND_URL value: {{ .Values.ui.backendUrl | quote }} {{- end }} + {{- with .Values.ui.listenIPv6 }} + - name: NGINX_LISTEN_IPV6 + value: {{ . | quote }} + {{- end }} {{- with .Values.ui.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/helm/litellm/tests/ui_listen_ipv6_tests.yaml b/helm/litellm/tests/ui_listen_ipv6_tests.yaml new file mode 100644 index 00000000000..e4314e3c536 --- /dev/null +++ b/helm/litellm/tests/ui_listen_ipv6_tests.yaml @@ -0,0 +1,33 @@ +suite: test ui IPv6 listener toggle +templates: + - ui/deployment.yaml +values: + - ./values/required.yaml +tests: + - it: renders no NGINX_LISTEN_IPV6 env by default + asserts: + - notContains: + path: spec.template.spec.containers[0].env + any: true + content: + name: NGINX_LISTEN_IPV6 + + - it: renders NGINX_LISTEN_IPV6=auto when listenIPv6 is auto + set: + ui.listenIPv6: auto + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: NGINX_LISTEN_IPV6 + value: auto + + - it: renders NGINX_LISTEN_IPV6=true when listenIPv6 forces the listener on + set: + ui.listenIPv6: "true" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: NGINX_LISTEN_IPV6 + value: "true" diff --git a/helm/litellm/values.yaml b/helm/litellm/values.yaml index cd377667602..50ed3b360ed 100644 --- a/helm/litellm/values.yaml +++ b/helm/litellm/values.yaml @@ -347,6 +347,11 @@ backend: ui: enabled: true logLevel: INFO + # IPv6 listener for the ui nginx, rendered as NGINX_LISTEN_IPV6 on the + # container: "auto" listens on [::]:3000 when the pod has an IPv6 stack + # (dual-stack clusters), "true" forces it, "false"/empty keeps today's + # IPv4-only bind. Leave empty unless kubelet probes reach the pod over IPv6. + listenIPv6: "" extraEnv: [] envConfigMaps: [] envSecrets: []