Skip to content

chore(k8s): quiet the gateway config warnings and correct its comments #5302

Closed

Description

@dan-petty

Problem or Motivation

The LiteLLM gateway config has warnings and old comments. Some log lines look like configuration errors, but they are not. Other comments describe LiteLLM behavior that changed. An operator who reads them gets a wrong model of the gateway.

1. Client error messages carry the internal fallback map. k8s/llm/gateway/config.yaml litellm_settings (lines 202-223) does not set expose_router_debug_in_errors. In LiteLLM 1.103.11 the default is True (litellm/__init__.py:221; its comment says that a future major release changes the default to False). router.py:7345, 7377, 7399 and 7431 append Received Model Group=..., Available Model Group Fallbacks=... and No fallback model group found for lookup_groups=<g>. Fallbacks=[<full map>] to ProxyException.message. Thus each client sees the model-group and fallback wiring, also through the tunnel.

  • Loki, 7 days: 12 Router:ERROR lines with this text (deepseek-v4.1-flash-1017 8, claude-sonnet-5-5 2, typesafe/jev-1.14 2).
  • 3 POST /v1/chat/completions 500 answers to roadmap-service pods carried it (2026-11-10T11:30:37Z, 2026-11-11T02:06:42Z and 2026-11-11T17:13:50Z).
  • Each event was a provider failure (an OpenRouter stream drop, an Anthropic 400 or a Jev 400), but the text reads like a gateway configuration error.
  • git grep finds no code in src, tests, k8s or docs that parses these strings.

2. The trusted_proxy_ranges WARNING at each start. Loki, 7 days: 11 login_throttle.py:123 - trusted_proxy_ranges is not set or not a valid list of ranges... lines, one at each good start. general_settings (lines 279-313) does not set the key. Do not set it to the pod network:

  • login_throttle.py:302-309 (_keys): the only counters are the pair (source group, username) and the source group. No counter uses the username alone. source_group (lines 243-250) keeps an IPv4 address as it is.
  • network.py resolve_client_ip trusts X-Forwarded-For from each peer in the ranges.
  • The gateway has 3 inbound paths: Cloudflare to cloudflared to Traefik, the LAN NodePort, and direct pod calls. The Service llm-gateway is a NodePort with externalTrafficPolicy: Cluster, so LAN clients reach LiteLLM from the SNAT node bridge address in the pod network (3,600 requests in 6 h). Traefik keeps incoming forwarded headers (k8s/ingress/traefik-values.yaml:20-21).
  • No CIDR holds only the proxies. If the gateway trusts the pod network CIDR, a NodePort client or any pod can forge X-Forwarded-For and get a new source for each attempt. That escapes the pair limit, which works today as a per-username limit, and also the new source limit.

Thus the WARNING is expected, but no comment says why.

3. deployment.yaml comments describe old LiteLLM behavior.

  • k8s/llm/gateway/deployment.yaml:79 says that the pod waits for the database. No init container exists. LiteLLM v1 tries the database 4 times in about 5 s with no delay. On 2026-11-12, a new pod logged Running prisma migrate deploy at 14:31:23.617, then P1001 at 24.767, 25.972, 27.213 and 28.454, and exited with code 1 at 14:31:30Z.
  • Lines 85-87 say that without ENFORCE_PRISMA_MIGRATION_CHECK, LiteLLM goes on with an empty schema. But proxy_cli.py:951-961 has default=True.
  • config.yaml:223 telemetry: false and deployment.yaml:97-98 LITELLM_TELEMETRY: no code in litellm 1.103.11, litellm-proxy-extras 0.4.100.post2, litellm-enterprise 0.1.69.post2 or prod_entrypoint.sh reads either one.

4. config.yaml comments are wrong or missing.

  • config.yaml:128 says that for the hosted groups "No pool and no fallback names them". But config.yaml:272 makes deepseek-v4.1-flash-1017 the fallback of claude-sonnet-5-5, and 1,428 fallbacks used it in 7 days.
  • The Admin UI health column is empty: /model_group/info gives health_status: null for each group. background_health_checks defaults to false (proxy_server.py:6408), and general_settings sets no health key. Each Ollama tier serves 1 request (OLLAMA_NUM_PARALLEL "1", k8s/llm/profiles/ollama-profiles.yaml:148-149), and the health-check timeout is 60 s. No comment says that this is on purpose.
  • /v1/models returns 13 ids: the 12 model_name entries and embedding, the callable routing group of config.yaml:237-241 (router.py:1454-1494, 11753-11778). No comment or README text explains the extra id.

Proposed Solution & Architectural Design

All changes are in k8s/llm/gateway/config.yaml and k8s/llm/gateway/deployment.yaml. Put them in one pull request, because each edit of config.yaml rolls the gateway (the configMapGenerator hashes the raw file). Merge it after the grace-period fix of the related issue below, so that the rollout does not cut open calls.

  • config.yaml litellm_settings (lines 202-223): add expose_router_debug_in_errors: false with a one-line comment. The gateway log keeps the provider failure. Do this before build(k8s): move the LiteLLM gateway to v1.109 #5091, because a later major release changes this default anyway.
  • config.yaml general_settings (near line 280): keep trusted_proxy_ranges unset. Add a comment that names the 3 inbound paths and says that the pair (source, username) limit stays on, so the start-up WARNING is expected. Set a value only after the NodePort path is gone and a range holds only the ingress proxies.
  • deployment.yaml:77-89: rewrite line 79. The kubelet waits for the credentials object. LiteLLM tries the database 4 times in about 5 s and exits, and the kubelet restarts it with back-off. Rewrite lines 85-87: the variable pins the default of this version, and a failed migration ends the start with exit code 1.
  • deployment.yaml:97-98 and config.yaml:223: remove LITELLM_TELEMETRY and telemetry: false, or mark them as a harmless guard that v1.103.11 does not read.
  • config.yaml:127-129: name the hosted-only fallback chain.
  • config.yaml general_settings (lines 279-313): add a comment that background health checks stay off on purpose, because each tier has one slot and the hosted groups are billed. If the owner wants a health column, set background_health_check_model_groups: [qwen3-embedding:0.6b] only.
  • config.yaml:237-241: next to routing_groups, add a comment that embedding is a callable alias of qwen3-embedding:0.6b. Do not rename the group to a model_name, because LiteLLM then logs a shadowed WARNING.

Related: #5301 (the grace-period fix), #5091 (the LiteLLM v1.109 upgrade).

Target Subsystem

Kubernetes: the LiteLLM gateway manifests (k8s/llm/gateway/).

Existing Tool Considered

LiteLLM already has the settings (expose_router_debug_in_errors, trusted_proxy_ranges, background_health_check_model_groups). The change is configuration and comments only, with no new code.

Acceptance Criteria

  • After the rollout, Loki shows no client-facing error message that holds Fallbacks=[. The gateway log still records the provider failure.
  • trusted_proxy_ranges stays unset, and a comment in general_settings names the 3 inbound paths and the reason for the WARNING.
  • The comments at deployment.yaml:77-89 match the behavior of LiteLLM 1.103.11. telemetry: false and LITELLM_TELEMETRY are removed or marked as not read.
  • config.yaml:128 names the hosted fallback chain. Comments explain the empty health column and the embedding id.
  • The gateway starts with no new WARNING line.

Activity

  1. added
    source/agent
    type/chore
    scope/k8s
    status/new
    value/low
    effort/low
    on Nov 13, 2026
  2. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P3-Low. Warnings and stale comments cause operator confusion but do not break the gateway.
    • Related: chore(k8s): update litellm to v1.103.0 #732, which asks for a different change. Both are chores on k8s/llm/gateway files, but #732 bumps the image version while this candidate sets a config flag and fixes comments.
  3. added
    priority/p3-low
    on Nov 13, 2026
  4. added
    status/in-review
    and removed
    status/new
    on Nov 15, 2026
  5. removed
    status/in-review
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowscope/k8ssource/agenttype/chorevalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions