Upgrading LiteLLM on Kubernetes with the Helm migrations job

Run LiteLLM schema migrations once per release in a Helm PreSync job, not inside racing proxy pods. This page covers the job deadline, upgrade timeouts for large spend log tables and pinned image tags.

On this page

Why a LiteLLM upgrade on Kubernetes needs a migrations job

A LiteLLM upgrade on Kubernetes needs a migrations job when several proxy replicas share one PostgreSQL database and the new release changes its schema. By default, every proxy pod runs prisma migrate deploy at startup under a database lock, so the first pod migrates and the others wait. That works for a small deployment, but during a rolling update the new pods and the old pods can both be live while the schema is changing, and a failed or slow migration then shows up as crash-looping pods rather than a clean stop. Moving schema changes into a Helm PreSync job runs them once per release before any new proxy pod starts, and setting DISABLE_SCHEMA_UPDATE=true on the pods stops them from attempting migrations themselves.

The trigger for this move is the size of your deployment and your database, not a version number. Teams with several replicas, large request log tables or strict change windows usually make the switch. Before you do, confirm the release you are moving to on the LiteLLM upgrade guide, and check the supported line in the LiteLLM Enterprise documentation, which states that the four most recent stable minor versions are maintained for both open source and Enterprise deployments. Pin the exact image tag rather than a floating tag such as main-latest, so every pod in a rollout runs the same code and the migrations job matches the proxy it serves.

Plan the upgrade as a sequence with a backup before the migrations job starts. Confirm that your PostgreSQL backup is restorable, record the current image tag so you can roll back, and ask the vendor or your own test environment how long the migration will take on a copy of your largest spend log table. The timing of a migration depends on your data volume and database hardware, so measure it on a restored copy instead of relying on an estimate.

What changes between releases and what each change means for the upgrade

This table pairs each upgrade-relevant change with its impact on a Kubernetes rollout and the action the reader must take. Use it as a checklist before every upgrade, not as a substitute for the release notes. The main takeaway is that each release must be read in full for its own breaking changes and deprecations, and the items below are the ones to verify against it.

ChangeWhat it means for the upgradeAction needed
Migrations moved into the Helm PreSync jobSchema changes run once per release in the migrations job rather than in every proxy pod at startup, which avoids pods racing each other on the same database lock.Confirm the job runs and completes before proxy pods roll out, and check the job logs before rolling pods.
DISABLE_SCHEMA_UPDATE=true on proxy podsPods skip their own migration step, so a pod that starts without the job having run will not fix the schema itself.Set it only when the migrations job is enabled, and confirm the variable is present on every pod spec in the release.
migrationJob.activeDeadlineSeconds default of 1800 secondsThe job is stopped at this deadline. Large spend log tables can need longer, so an unfinished migration is killed mid-run.Estimate table size with your DBA, raise the deadline for large tables, and test on a restored copy first.
Index building before the job exitsThe job builds request log indexes before it completes, so index work on very large tables adds to the upgrade window.Measure index build time on a staging copy and set helm upgrade --timeout to exceed the job deadline.
Pinned exact image tags instead of main-latestA floating tag can pull different code onto different pods during one rollout, and the migrations job may not match the proxy version.Pin the same exact tag in the migrations job and the proxy deployment, and record the tag in your change record.
Release v1.105.1 on the releases pageThis release was published October 14, 2026. Its notes can change configuration keys, defaults or database expectations for your version path.Read the full v1.105.1 notes and every release between your current and target version for breaking changes and deprecations.
Release notes read in full for each versionBreaking changes and deprecations are listed per release, so skipping intermediate versions can miss a required config or schema step.List each release in the path, record the items that touch your config, database or deployment, and assign an owner for each.
Support window for minor versionsLiteLLM supports the four most recent stable minor versions, so an older line may stop receiving fixes.Confirm your current minor line is still supported and plan the upgrade path before it falls out of the window.

The PreSync job finishes before any proxy pod changes

The release starts with helm upgrade, which runs the migrations job as a PreSync hook before any proxy pod changes. The job applies schema changes to PostgreSQL and builds the request log indexes, and it must finish inside its activeDeadlineSeconds window, which is the timeout boundary. Only after the job succeeds does the proxy Deployment roll out pods with DISABLE_SCHEMA_UPDATE=true, so no pod races the job. Redis and the secret manager are runtime dependencies of the pods. If the job fails or hits its deadline, the release stops at the rollback point, so check the job status before retrying.

Release order for the PreSync job, proxy pods and their dependencies.

What to back up and inventory before the first upgrade

Each item below is something your team must produce and store before the first Helm upgrade touches the cluster. Together they give you a way back if the migration fails and a precise picture of what the new release will change. Skipping any one of them makes a rollback or an incident review much harder.

Verified PostgreSQL backup

Take a logical or physical backup of the LiteLLM database immediately before the job runs, and restore it into a scratch database to confirm it is readable. The migrations job alters the schema and builds request log indexes, so a backup taken hours earlier may not reflect the state you would need to return to. Record the backup time, the database size and the restore test result. Confirm with your database team how the backup is scheduled and who can authorize a restore.

Upgrade guide

Current and target image tags

Write down the exact image tag the running pods use now and the exact tag you plan to deploy, both as they appear in the Helm values or the Deployment spec. Do not record a floating tag such as main-latest, because it can point to different code on each pull. Store both values with the change ticket so that a rollback targets a known release. Confirm the target tag against the LiteLLM releases page before the change window opens.

LiteLLM releases

Configuration and callback inventory

List every file and setting the proxy loads: config.yaml, callbacks, custom Python code mounted into the pods, and any model or guardrail definitions that reference external services. Check each item against the target release's documentation, since a setting the new version does not know can stop pods from starting. Keep a copy of the rendered manifests so you can compare them after the upgrade. Ask the platform team to confirm where the config is sourced from in the chart.

Secret references used by the chart

Identify every Kubernetes Secret the chart reads, including the master key, the database connection string, Redis credentials and provider API keys. Confirm that each secret exists in the target namespace, that its keys match what the chart expects, and that a copy of its value is held in your secret manager. The master key must start with sk-, and changing it or the salt key during an upgrade can invalidate stored credentials. Record who owns each secret and how it rotates.

Staging copy with spend log size

Restore a recent copy of the production database into a staging environment and measure the size of the spend log table and its indexes. The migrations job builds request log indexes before it exits, so table size is the main driver of how long the job runs. Compare the measured run time with the job's activeDeadlineSeconds value, which defaults to 1800 seconds, and set the Helm timeout with margin. Ask your team to confirm whether staging data volume matches production.

Upgrade guide

Current pod and job settings

Capture the current values for DISABLE_SCHEMA_UPDATE, the replica count, the Uvicorn worker setting and the migrations job configuration as they are deployed. Confirm whether pods still run schema updates at startup, because a pod that migrates while the job also runs can cause lock contention. Save these values so you can confirm the post-upgrade state matches the plan. Verify them with a live read of the cluster, not only the chart defaults.

Production guide

How to run the upgrade with checks and rollback points

This sequence moves a LiteLLM gateway to a new release with the schema migration isolated in one Helm PreSync job, a verified PostgreSQL backup taken before any schema change, and a named rollback point at each stage. The result is a production upgrade where every pod runs the same pinned image and the team can show what was checked before traffic moved.

  1. Read every release note between current and target

    Before changing anything, the platform owner lists each LiteLLM release between the running version and the target, then reads the notes for each one. Look for schema changes, removed or renamed config keys, changes to the Helm chart values and changed defaults for routing or logging. Record which changes affect your config and which need a decision. Confirm the target is still within the release line LiteLLM supports, using its published support policy. The output is a short written upgrade record listing each change and its owner.

  2. Back up PostgreSQL and confirm the restore path

    The platform team takes a PostgreSQL backup immediately before the migration window and records its identifier and time. A backup that has not been restored is not a rollback point, so restore it into a separate instance and confirm that the gateway's keys, budgets and spend tables are present. Store the LITELLM_SALT_KEY value alongside the backup record, because it must stay unchanged across the upgrade. The output is a verified backup and a documented restore procedure that the on-call engineer can run.

  3. Set migration job and schema update values

    In the Helm values for the release, enable the migrations job and set DISABLE_SCHEMA_UPDATE=true on the proxy pods so that only the PreSync job applies schema changes. Review the migrationJob settings for the activeDeadlineSeconds value, which defaults to 1800 seconds. Check current table sizes in the spend log tables, and if they are large, plan a higher activeDeadlineSeconds and a longer helm upgrade --timeout, then confirm both values with the vendor documentation for your chart version. Render the chart with helm template and diff the output against the running release. The output is a reviewed values file that changes only the migration settings and the image tag.

  4. Pin the exact image tag

    Replace any floating tag such as main-latest with the exact image tag for the target release, in the chart values and in any separate job or cron resources that use the same image. LiteLLM's upgrade guide asks for a pinned tag so that every pod in the rollout runs the same code. Check that no pod is left on the old image after the rollout, and that the job and proxy pods report the same tag. The output is a single image tag recorded in version control and matched across all workloads.

  5. Rehearse the upgrade in staging

    Restore the production backup into a staging database of similar size, then run the same helm upgrade command with the same values. Measure how long the migrations job takes against the production-sized spend log tables, and compare that with the activeDeadlineSeconds value. Test virtual key authentication, a budget check, a routed model call and a spend write, then confirm spend rows appear in the database. Adjust the timeout if the job approaches its deadline. The output is a staging run record showing the timings and checks that passed, which the production change will reference.

  6. Declare the rollback point and upgrade production

    Before running the production upgrade, the change owner records the backup identifier, the previous image tag and the previous Helm revision as the rollback point. Start helm upgrade with the agreed --timeout, watch the PreSync job logs until it completes, then watch the proxy rollout. If the job fails or exceeds its deadline, stop and roll back to the recorded point instead of retrying with proxy pods running a mixed state. The output is a completed Helm revision with a recorded rollback point and job logs saved to the change record.

  7. Verify health and spend writes after rollout

    After the proxy pods are ready, check the health endpoints on every pod, confirm that each pod reports the pinned image tag, and send test requests through a virtual key that has a budget and a model restriction. Confirm that the request appears in spend logs, that the budget counter moves, and that errors are absent from pod logs for at least one full request cycle. Compare the request counts with the period before the change. The output is a signed-off verification checklist that closes the change, and any failed check is a trigger for the rollback procedure.

How to set the job deadline and Helm timeout for large spend log tables

The migrations job has its own clock, and the Helm timeout has to outlast it. The job is stopped after migrationJob.activeDeadlineSeconds, which defaults to 1800 seconds. If the job is cut off, the release fails partway through a schema change, so the deadline must be set with headroom for the slowest step. The helm upgrade --timeout value must be longer than that deadline plus the time pods need to roll out after the job finishes. A timeout shorter than the deadline means Helm gives up while the job is still legitimately running, and the rollout is left in an unclear state.

The main driver of the value is index building. Before it exits, the migrations job builds the request log indexes, and that cost grows with the size of the spend log table. On a table that is already large, building indexes can take far longer than the default allows, so the deadline and timeout must be raised before the upgrade, not after the first failure. Do not pick a number from a guess or from another team's cluster. Check the current row count and on-disk size of the spend log table in PostgreSQL, then run the upgrade against a restored copy of the production database with the same release and the same index work. Record how long the job took, then set the deadline with a clear margin above that measured time.

Confirm three things before the production window: the deadline in your chart values, the Helm timeout passed on the command line, and the rollout time of your proxy deployment in the test run. Keep a note of the figures used so the next upgrade starts from measured data. If the copy test shows the job approaches the deadline, plan a larger database maintenance window or extend the deadline rather than letting the job run close to the limit. Review the LiteLLM upgrade guide for the current settings before you change them.

Pinning image tags across staging, production and rollback

Staging is where the team proves that the migrations job, the pod configuration and the Helm values behave the way the production runbook assumes. The image tag used in staging should be the exact tag that production will receive, not a convenient moving reference. If staging runs a floating tag, the team rehearses against whatever build happened to be published that day, and the result says little about the build production will actually run. Pin the tag in the Helm values file that staging reads, then promote that same value unchanged through the pipeline.

  • Use the exact release tag: Set the image tag in the values file to the full release version rather than a branch-style or latest-style name, so the rehearsal and the later rollout pull the same image digest.
  • Keep one values file per environment: Store the tag in version control next to the other settings, so a reviewer sees exactly which build staging tested.
  • Run the migrations job in staging first: Confirm that the PreSync job completes, that DISABLE_SCHEMA_UPDATE is set on the proxy pods, and that the pods start after the job finishes.
  • Record the rehearsal result against the tag: Note the tag, the time the job took and any warnings, so the production change references a tested build.

Before promoting, confirm that the tag in the staging values file matches the tag you intend to deploy to production, character for character.

What makes a LiteLLM Kubernetes upgrade take longer

This table compares the factors that lengthen a LiteLLM upgrade on Kubernetes and the direction each one pushes the effort. Read each row as a question to answer for your own environment before you schedule the change window. The main takeaway is that the migration job itself is rarely the only long step: table size, version gap and test scope usually decide the total time.

DriverWhy it changes effortWhat to check before the change
Minor versions crossedEach minor release can add migrations and config changes, so a larger gap means more release notes to read and more schema steps to run.List every release between your current and target tags and read each upgrade note.
Size of spend and request log tablesThe migrations job builds request log indexes before it exits, so larger tables lengthen the migration step and the time writes may be constrained.Measure row counts and table sizes in PostgreSQL and compare them with the job deadline.
Custom callbacks or config keys removed in the target releaseRemoved keys can stop pods from starting, so each one adds a config edit and a retest.Compare your config file against the target release notes and remove or replace deprecated keys.
Number of replicasMore pods mean more rollout steps and more health checks, though pods with DISABLE_SCHEMA_UPDATE=true do not add migration work.Confirm the rollout strategy and readiness probes so old and new pods do not run mixed schemas.
Redis dependencyShared rate limits, router state and cache live in Redis, so a Redis version or configuration change adds a second dependency to verify.Confirm Redis is at version 7.0 or newer and that cached state survives the restart.
Secret and Helm values drift between environmentsA value that differs between staging and production can surface only during the production rollout, causing retries and rollbacks.Diff Helm values, image tags and secrets across environments, including LITELLM_MASTER_KEY and the database connection.
Number of test pathsVirtual keys, budgets, routing and SSO each need a check, and failures in one path often send the team back to the migration step.Write a short test list covering keys, budgets, routing and SSO, and run it on a staging copy of the database.
Helm timeout and deadline settingsIf the timeout is shorter than the migration job, the Helm release can fail mid-run and leave the team to recover state.Set the job deadline and the helm upgrade timeout together, based on a measured run in staging.

Questions teams ask before upgrading LiteLLM on Kubernetes

How much does an outside upgrade of LiteLLM on Kubernetes cost?

No public price applies, and DeployOpen does not publish a price list. A quote follows from a written scope, and the main cost drivers are the number of environments (staging and production, plus any air-gapped or regional copies), how many LiteLLM releases sit between your current version and the target, the size and state of the PostgreSQL database, whether Redis and the Helm chart are already managed as code, and how much testing and rollback rehearsal you want written into the scope. Costs are one-time for the upgrade itself. Ongoing support, upgrades and continuous testing are separate retainers. Ask any provider for a quote that lists each deliverable, the environments covered, the rollback test and who performs the production change window.

How long does a LiteLLM Helm upgrade project take?

Duration depends on the work, not on a fixed number, so ask for a timeline that is tied to the written scope. The main factors are the number of LiteLLM minor versions to cross and their release notes, the size of the request log tables (migrations build indexes on those tables before the job exits), how many environments must be upgraded in sequence, the time needed for a full PostgreSQL backup and restore test, and how quickly your change approval process can schedule a window. Confirm with your own environment how long a backup of your largest spend table takes, because that number sets the floor for the maintenance window.

What does the client team need to provide for the upgrade?

The work needs access and decisions from your side before any change is made. Plan to provide:

  • Read access to the Helm release, values files, and the cluster namespace where LiteLLM runs
  • A current PostgreSQL backup and credentials that let the migration job connect
  • The LITELLM_MASTER_KEY and LITELLM_SALT_KEY handling process, along with confirmation that the salt key will not change
  • A named approver for the production change window and the rollback decision
  • Confirmation of Redis topology if more than one proxy instance runs

Ask which of these items your team already holds so the schedule does not stall on access requests.

Can an internal platform team upgrade LiteLLM on Kubernetes alone?

Yes, many platform teams can do it with the right preparation, and the decision depends on skills and capacity rather than on the product alone. The team needs working knowledge of Helm, Kubernetes Jobs and rollout behavior, PostgreSQL backup and restore, and the LiteLLM upgrade guide for the versions in between. It also needs a rehearsal in a non-production environment that uses a copy of the database. Teams that lack a staging environment, have no tested restore, or have not read every intervening release note usually benefit from an outside review of the plan before the production change.

How does the Helm timeout relate to large spend log tables?

The migrations job runs in a Helm PreSync hook, and the job's activeDeadlineSeconds defaults to 1800 seconds. The job builds request log indexes before it exits, so a very large spend log table can exceed that deadline and the job is stopped. Raising migrationJob.activeDeadlineSeconds and the helm upgrade --timeout value must be done together, because a longer job also needs the Helm wait window to cover it. Size the new values from a measured migration run on a copy of your production data, not from a guess, and confirm the figure with your own table size and index build time.

Why set DISABLE_SCHEMA_UPDATE on the proxy pods?

Setting DISABLE_SCHEMA_UPDATE=true stops each proxy pod from running prisma migrate deploy at startup, so schema changes happen once in the migrations job instead of being raced by several pods. Without it, a rolling update can start many pods that each try to migrate, which adds locking and startup failures. The trade-off is that pods will not update the schema themselves, so the migrations job must succeed before the new deployment is rolled out. Confirm this flag and the job ordering in a staging rollout first.

Should we pin the LiteLLM image tag before upgrading?

Yes. LiteLLM's upgrade guide advises pinning the exact image tag instead of a floating tag such as main-latest, so every pod in a rollout runs the same code and the migration version matches the proxy version. Record the exact tag in your values file under version control, and confirm the tag exists in the release list before the change window. A pinned tag also makes rollback predictable, because the previous tag is known and tested.

Which release line to stay on and how far to upgrade in one step

Stay on one of the four most recent stable minor versions. LiteLLM maintains support for the four most recent stable minor versions for both open source and Enterprise deployments, so a gateway that has fallen behind that window needs intermediate upgrades before it reaches a supported line. Each step is a separate schema change, and each one carries its own risk of a long migration on the spend log tables. Before you pick a target, check the current line on the LiteLLM releases page, which lists the latest published release, and compare your running version against the four lines it maintains.

Plan the path as a sequence of stops rather than a single jump. Read every release note between your current version and the target, and note any release that changes the database schema, removes or renames a configuration key, or changes default behavior for keys, budgets or routing. Those notes decide how many stops you need and how long each Helm migrations job may run. Confirm with LiteLLM which migrations each intermediate release applies, because the upgrade guide is the authority for the job's deadline and timeout settings, and a skipped stop can leave the migrations job working against a schema it was not written for.

Record the version you run now and the version you intend to reach, then rehearse each step against a restored copy of your PostgreSQL database before touching production. Time the migrations job in that rehearsal, because the job's activeDeadlineSeconds default of 1800 seconds is the limit that stops a long index build mid-run. If a rehearsal step approaches that limit, plan a higher value and a longer helm upgrade --timeout for the production run, and do not start the next stop until the previous one has finished and the pods are healthy.

How DeployOpen scopes, delivers and supports a LiteLLM upgrade

DeployOpen treats a LiteLLM upgrade on Kubernetes as a planned change to a production gateway, not a image bump. We start from your current release, your database size and your Helm values, then agree in writing how migrations run, how long the window is and how a rollback would work.

How we scope

  • Inventory the running LiteLLM image tag, Helm chart values, replica count and whether DISABLE_SCHEMA_UPDATE is already set on the pods.
  • Measure the PostgreSQL request log tables, since migrationJob.activeDeadlineSeconds and the helm upgrade timeout depend on their size.
  • Agree in writing the target release, the migration window, the rollback path and which release notes are reviewed before work starts.

How we build

  • Pin the exact image tag for the proxy and migrations job so every pod in the rollout runs the same code.
  • Configure the PreSync migrations job, set DISABLE_SCHEMA_UPDATE=true on proxy pods and raise the job deadline and Helm timeout where table size requires it.
  • Rehearse the upgrade on a non-production copy of the database and record how long the migrations job and index build actually take.

How we hand over

  • Deliver the Helm values, pinned tags, runbook steps and the timing observed during rehearsal, with the reasoning behind each setting.
  • Document the pre-upgrade PostgreSQL backup, the Helm rollback steps and the checks that confirm proxy pods are healthy after the change.
  • Walk your platform and database engineers through the runbook so they can repeat the upgrade on the next release line without us.

How we support

  • Support is fixed-scope by default, with the upgrade, its testing and the handover agreed in writing before work begins.
  • Ongoing upgrades, release tracking and continuous testing for the gateway are available as a retainer.
  • Confirm with your team how long support must cover each release line, using the maintenance policy LiteLLM publishes for its supported minor versions.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.