Skip to main content
Version: 1.12.1

Upgrade AISIX Enterprise

AISIX Enterprise upgrades the control plane first and the gateways second. Existing gateways continue serving traffic while you upgrade and verify the control plane, then you can roll out the matching gateway release in stages.

The procedure differs for package and Helm installations, but both paths require the same preparation. Review every intervening release, create a complete recovery set, and decide how you will verify or roll back the deployment. For OpenShift or OKD, follow Upgrade AISIX Enterprise on OpenShift or OKD.

Plan the Upgrade​

The oldest control plane that can upgrade to this release is 1.9.0. cp-api refuses an older source before changing the database. The package's run.sh refuses it based on the version in .env. A control plane at 1.9.0 or later can upgrade directly to a later release. You do not need to install each intermediate release, but you must complete the applicable upgrade actions from every release you skip.

Use this sequence for both package and Helm installations:

  1. Read the release notes from the release after your source version through the target version.
  2. Complete the source-specific preparation.
  3. Create and verify a recovery set containing the database, secrets, deployment configuration, and matching software.
  4. Upgrade the control plane by following the package or Helm procedure on this page.
  5. Verify the control plane, then complete any required source-specific action, such as consolidating legacy organizations.
  6. Upgrade each gateway release and monitor the deployment through your normal observation period.
  7. Complete optional cleanup only after the rollback window closes.

Mixed-Version Behavior​

During the rollout, the control plane can run a newer release than its gateways. This allows a staged fleet upgrade, but a setting introduced after an older gateway release might not take effect there. The oldest gateway release the control plane supports is 1.9.0.

What happensControl-plane behaviorOperator action
An older gateway can load the resource and safely ignore an unknown field.The save succeeds with a warning that identifies the field, affected gateway versions, and affected count.Do not rely on that field until the affected gateways are upgraded. This is especially important for restrictive settings.
An older gateway cannot load the resource, or it only supports UTC and the organization is changing to a non-UTC budget time zone.The save fails with HTTP 422 and DP_INCOMPATIBLE. Nothing is written.Upgrade the affected gateways or leave the incompatible setting out.
A gateway runs a release older than 1.9.0.The control plane ignores that gateway: saves are not checked against it, return no warning about it, and leave it out of every compatibility count. Data planes marks the gateway Unsupported version. The gateway may fail to load the saved configuration.Upgrade the gateway to 1.9.0 or later.
A gateway registers or rolls back after the save, or reports an unrecognized version.The earlier save might not have been checked against that gateway.Verify the runtime state in the environment overview and Data planes view. See Resource Projection.

Gateway versions are shown per instance in Data planes. The control-plane version appears at the bottom of the dashboard navigation and is returned by the public configuration endpoint. See Verify the Deployment.

A restarted gateway can remain in the compatibility check for up to five minutes. If a save is refused for a release you have already replaced, wait for the old registration to expire and retry.

Requests During a Control-Plane Upgrade​

From 1.11.0, a cp-api that finds the database migrated by a newer control plane stops serving instead of working against the newer database:

  • Every /api/* request returns 503 with the error code CP_UPGRADING and Retry-After: 5, without running. SCIM requests (/scim/v2/*) return 503 with Retry-After in the SCIM error format. Admin API and SCIM clients can send the request again unchanged after the time Retry-After gives. During a rolling upgrade with several replicas, a request that reaches a replica still on the older release gets this answer until the rollout replaces it.
  • The replaced cp-api stays ready: /readyz and /healthz both return 200, so a load balancer keeps routing to it and callers receive the upgrade answer rather than no answer. dp-manager also stays ready.
  • The dashboard shows The control plane is being upgraded. Retrying automatically…, also on a full page load, and retries automatically for up to 10 minutes. After that, it shows the upgrade message until the page is reloaded.
  • cp-api and dp-manager refuse to start on a database recorded by a newer control plane. A running one exits if the recorded version is rolled back below its own. There is no override; roll back by restoring the recovery set, as described in Roll Back.
  • cp-api and dp-manager must run the same version. If you upgrade only cp-api, the older dp-manager refuses to start at its next restart.

A 1.10 control plane does not have this fence. During a rolling upgrade from 1.10, once the 1.11.0 migration has run, a cp-api replica still on 1.10 answers 500 on organization routes, and writes made through it in that window, such as role changes, invitations, and SCIM or SSO provisioning, may be lost. Do not make changes during such an upgrade. A stop-then-start upgrade is not affected.

Prepare for Version-Specific Changes​

Before running the package or Helm procedure, check whether the following applies to the source deployment.

Source releaseBefore upgradingAfter upgrading
Any supported source with several organizationsInventory the organizations, their owners, and the users and resources that must be retained. Verify the recovery set before continuing.Consolidate them into one, then verify access.

Upgrade a Package Installation​

Online and air-gapped packages follow the same upgrade model: replace the package files in the existing installation directory, then run the updated startup script. The package preserves the deployment's environment file and PostgreSQL data volume.

Back Up the Installation​

Create a complete recovery set before replacing any files. The first control-plane start under the target release migrates the database, so rollback requires the matching database backup, secrets, configuration, and previous package.

Upgrade an Online Installation​

From the directory that contains aisix-self-hosted, run the quickstart again. It downloads the current package, extracts it over the existing installation, and starts the upgrade:

curl -sL "https://run.api7.ai/aisix-self-hosted/quickstart" | bash

Upgrade an Air-Gapped Installation​

On a connected machine, download the package for the air-gapped host's CPU architecture. This URL resolves to the current release; version-pinned packages are published alongside it.

curl -fSL "https://run.api7.ai/aisix-self-hosted/aisix-self-hosted-offline-1.12.1-linux-amd64.tar.gz" \
-o aisix-self-hosted-offline-1.12.1-linux-amd64.tar.gz

Replace amd64 with arm64 for an AArch64 host. The legacy URL without an architecture suffix still resolves to the AMD64 package. The startup script refuses a mismatched package before loading any image and prints the correct download URL.

Transfer the archive to the target host and extract it from the directory that contains the installation:

cd /path/that/contains/aisix-self-hosted
tar -xzf aisix-self-hosted-offline-1.12.1-linux-amd64.tar.gz
cd aisix-self-hosted
./run.sh
caution

Extract the package over the original installation directory. Extracting it from inside that directory creates a nested copy and does not upgrade the running installation. Extracting into a different directory leaves the new copy without the original environment file, and the startup script refuses to take over a stack running elsewhere.

Verify the Package Upgrade​

For a normal release-to-release upgrade, the package updates AISIX_VERSION in .env to the packaged release. A non-release value is treated as an operator-owned custom pin and is preserved. The package does not change deployment secrets or replace the data volume. Confirm the running images after the script finishes:

COMPOSE_PROJECT_NAME=aisix-self-hosted docker compose images

Three optional image overrides take precedence over the package version: AISIX_API_IMAGE, AISIX_DPM_IMAGE, and AISIX_CLOUD_DP_IMAGE. Remove an override before upgrading if that component should follow the package. See AISIX Enterprise Configuration.

On an air-gapped host, image archives from the previous package remain available until the new release starts successfully. This preserves the images needed for rollback if startup fails.

Upgrade with Helm​

The control-plane and gateway charts use the same release number. Upgrade and verify the control plane before changing any gateway release.

Prepare the Helm Upgrade​

Install Helm 3.15 or a later Helm 3 release, cURL, and jq. Plan a control-plane maintenance window, and create a complete recovery set whether the database is bundled or external. Verify that the database backup in the set can be restored before continuing.

The examples use aisix-cp as the control-plane release name and aisix as its namespace, matching Deploy the AISIX Enterprise Control Plane. If your deployment uses different names, find them with helm list -A and substitute them throughout the procedure.

Set the control-plane release, namespace, target version, and timeout:

export CP_NAMESPACE="aisix"
export CP_RELEASE="aisix-cp"
export TARGET_VERSION="1.12.1"
export CP_UPGRADE_TIMEOUT="35m"

The timeout exceeds the chart's default control-plane startup budget. Increase it if database migrations can take longer.

Record the installed control-plane chart and application versions before making changes:

helm list --namespace "$CP_NAMESPACE"
kubectl get pods --namespace "$CP_NAMESPACE"

Refresh the chart repository and confirm that the target chart is available:

helm repo add api7 https://charts.api7.ai
helm repo update
helm show chart api7/aisix-cp --version "$TARGET_VERSION"

Use a maintained values file rather than --reuse-values. Reusing the resolved values from the source chart can prevent target-chart defaults, including probe budgets, from taking effect.

Point the examples at the values file maintained for the release:

export CP_VALUES_FILE="your-cp-values.yaml"

If you do not have a maintained file, export only the user-supplied values with restrictive permissions:

export CP_VALUES_FILE="cp-values.yaml"

umask 077
touch "$CP_VALUES_FILE"
chmod 600 "$CP_VALUES_FILE"
helm get values "$CP_RELEASE" \
--namespace "$CP_NAMESPACE" \
-o yaml > "$CP_VALUES_FILE"

Do not export computed defaults with helm get values --all. Treat the values file as sensitive because it can contain credentials.

Review Control-Plane Values​

Configure application settings through chart values. Reserve extraEnvVars for system-level variables such as TZ; secrets remain in Kubernetes Secrets.

An application setting supplied through extraEnvVars still overrides the rendered configuration file after the upgrade. Move each setting to its chart value, then remove the environment-variable override so the values file remains the source of truth.

Environment-variable overrideChart value
AISIX_TRUSTED_ORIGINSapi.trustedOrigins
AISIX_CLOUD_SSRF_PROTECTION_ENABLEDapi.outbound.ssrfProtection.enabled

See Helm Values for the complete mapping.

Check Image Pins​

Check whether the installed release pins either control-plane image:

helm get values "$CP_RELEASE" \
--namespace "$CP_NAMESPACE" \
-o json \
| jq '{api_image_tag: (.api.image.tag // ""), dpm_image_tag: (.dpm.image.tag // ""), generated_gateway_image: (.api.dpImage // "")}'

Review each returned value:

ValueAction
API or data-plane manager image tagAn empty tag follows the target chart. Remove an old pin or update it to a target-compatible image.
Generated gateway imageThis image appears in dashboard-generated installation commands. Clear or update an old pin; preserve only a deliberate target-compatible custom image.

Render the Upgrade​

Resolve the control-plane API Deployment name from the Helm release label:

export CP_API_DEPLOYMENT="$(kubectl get deployment -n "$CP_NAMESPACE" \
-l "app.kubernetes.io/instance=$CP_RELEASE,app.kubernetes.io/component=api" \
-o jsonpath='{.items[0].metadata.name}')"

printf 'Control-plane API: %s\n' "$CP_API_DEPLOYMENT"

Stop and verify the release name, namespace, and Kubernetes context if the value is empty.

Render the upgrade against the live cluster before changing the release. --dry-run=server permits cluster lookups and OpenAPI validation, while --hide-secret prevents Helm from printing rendered Secrets to the terminal or CI log:

helm upgrade "$CP_RELEASE" api7/aisix-cp \
--namespace "$CP_NAMESPACE" \
--version "$TARGET_VERSION" \
--values "$CP_VALUES_FILE" \
--dry-run=server \
--hide-secret

This command does not submit the rendered objects to Kubernetes admission. Treat it as a rendering and OpenAPI check, not as validation of SCCs, quotas, or admission policies. Resolve every reported error before continuing.

Inspect every image in the target control-plane render:

helm template "$CP_RELEASE" api7/aisix-cp \
--namespace "$CP_NAMESPACE" \
--version "$TARGET_VERSION" \
--values "$CP_VALUES_FILE" \
| grep -E '^[[:space:]]+image:'

The aisix-cp-api and aisix-cp-dpm images should use the target version or a deliberate target-compatible custom tag. PostgreSQL is an independently versioned chart dependency. Keep the PostgreSQL image tag rendered by the target chart unless a separately tested database-image plan requires another tag.

Upgrade the Control Plane​

Upgrade without --atomic. The control-plane API migrates the database during startup, while an automatic Helm rollback changes only Kubernetes objects and does not restore the complete recovery set.

helm upgrade "$CP_RELEASE" api7/aisix-cp \
--namespace "$CP_NAMESPACE" \
--version "$TARGET_VERSION" \
--values "$CP_VALUES_FILE" \
--wait \
--timeout "$CP_UPGRADE_TIMEOUT"

If the first Helm upgrade removes a variable that was not moved, stop the procedure:

  1. Repeat the same Helm upgrade with the unchanged values file to restore the missing variable.
  2. Confirm that the component has recovered and the variable is present again.
  3. Move the setting to its target chart value, remove the extraEnvVars override, render the release again, and apply the corrected upgrade.

Recovery after the second command does not validate the first attempt. It confirms only that the previous configuration was restored. If AISIX_CLOUD_MASTER_KEY was removed, cp-api repeatedly restarts with master key is not set: set AISIX_CLOUD_MASTER_KEY to the base64-encoded 32-byte key dp-manager has in AISIX_DPMGR_MASTER_KEY. It cannot become ready until the key is restored.

Watch the rollout. If the API pod does not become ready, describe the non-ready pod first and read its logs if the container started:

kubectl rollout status -n "$CP_NAMESPACE" \
"deployment/$CP_API_DEPLOYMENT" \
--timeout="$CP_UPGRADE_TIMEOUT"

kubectl get pods -n "$CP_NAMESPACE" \
-l "app.kubernetes.io/instance=$CP_RELEASE,app.kubernetes.io/component=api"

kubectl describe pod -n "$CP_NAMESPACE" <non-ready-cp-api-pod>

kubectl logs -n "$CP_NAMESPACE" \
<non-ready-cp-api-pod> \
--all-containers \
--tail=300

A failed database migration, an unreachable database, or a missing Secret can prevent the API from becoming ready. Do not repeatedly rerun the upgrade for those failures. If the migration cannot complete, follow Roll Back to restore the complete pre-upgrade recovery set. If a variable that the values still set is missing from the Deployment, run the upgrade command again with the same values to put it back.

The data-plane manager can briefly log missing-table errors while the API applies database migrations. It retries automatically. Investigate the errors if they continue after the API becomes ready.

Verify the Control Plane​

Verify the control-plane version through its public endpoint. Set AISIX_CP to the existing AISIX Cloud Admin API base URL, including /api and without a trailing slash:

export AISIX_CP="YOUR_AISIX_CONTROL_PLANE_API_URL"

curl -fsS "$AISIX_CP/config/public" | jq '{cp_version, cp_commit}'

Sign in to the dashboard and confirm that organizations, environments, models, provider keys, and caller API keys are present. In each environment's Data planes view, confirm that the existing gateways remain healthy.

Monitor Database Work​

The control-plane API applies schema migrations before it becomes ready. Some releases also build indexes after the API starts serving, so the dashboard and gateway configuration delivery can become available before all database work finishes.

Watch the control-plane API logs for these messages:

Log messageMeaning
building index or index build progressA background index is being built. Duration and database load depend on table size and infrastructure.
index builtOne index has completed.
background index build: every index is in placeAll background indexes are ready. Wait for this message before starting another upgrade.

While required indexes are being built, request records continue to be stored, but budget accounting and some cleanup jobs wait. Until the usage index is ready, the Overview and Usage pages show zero, including traffic received after the upgrade, together with a backfill notice. After that index is ready, those pages fill in earlier usage in the background and stay incomplete until the notice disappears. See Backfill after an Upgrade.

Plan an off-peak window for a deployment with large usage tables because index creation increases database CPU, I/O, and write-ahead logging.

Package Upgrade Progress​

The package startup script brings PostgreSQL, the control-plane API, the data-plane manager, and the remaining services up in order. When a stage takes longer than expected, it prints progress every 30 seconds:

MessageAction
cp-api is still migrating the databaseLeave the migration running. If the message identifies a table lock, inspect the API logs for the blocking session.
cp-api is still startingContinue waiting for the first startup to finish.
PostgreSQL is recovering from an unclean shutdownWait for PostgreSQL readiness as described below.

Pressing Ctrl-C does not stop a database migration already running in the container, but the startup script is still needed to start later services. Run it again after the migration completes. Use ./run.sh logs api to follow migration and index progress.

Table Locks Held by Another Session​

Migration work retries rather than waiting indefinitely behind a table lock. The control-plane API log identifies the blocking session, including its process ID, application name, transaction start time, and query. Let that transaction finish or end it; also confirm that no control-plane replica from the previous release is still using the database.

Tables Owned by Another Role​

At startup, the control-plane API removes any row-level security (RLS) settings that an earlier release left on the control-plane tables. If a table carrying those settings belongs to another role, startup stops without changing any table.

Ask the table owner or a database administrator to run the statements named in the startup error for every affected table:

ALTER TABLE public."<table>" NO FORCE ROW LEVEL SECURITY;
ALTER TABLE public."<table>" DISABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS tenant_isolation ON public."<table>";

Start the control plane again after correcting every affected table.

PostgreSQL Recovery After an Interrupted Stop​

./run.sh stop and ./run.sh down give each container up to 2 minutes to shut down, because PostgreSQL's shutdown checkpoint can take longer than the 10-second Docker Compose default after heavy writes. A stop made with the previous package's run.sh still uses 10 seconds.

If PostgreSQL was interrupted, it replays its write-ahead log before accepting connections. The startup script waits up to 30 minutes and reports recovery progress. If recovery takes longer, wait until ./run.sh logs postgres shows database system is ready to accept connections, then run ./run.sh again.

Complete Required Post-Upgrade Actions​

Complete any action that blocks normal control-plane use before upgrading the gateway fleet.

Consolidate Several Organizations into One​

A supported control plane can still hold several organizations if it was upgraded earlier from a release that allowed organization creation. After the current upgrade, users cannot access the dashboard until only one organization remains; admin tokens and gateway traffic continue to work.

danger

Consolidation permanently deletes every organization except the one you keep, including organizations you do not belong to. Environments, models, caller API keys, members, and usage and audit records are deleted with them. Certificates for gateways connected to deleted environments are revoked. There is no undo. Restore the database backup if you need to recover the deleted data.

An owner of at least one organization can consolidate after signing in with a password:

  1. Open the Keep one organization page.
  2. Choose the organization to retain. Only organizations you own are offered.
  3. Review every organization that will be deleted.
  4. Type the retained organization's slug, shown in parentheses beside its name, then select the delete button. Its label includes the number of organizations that will be deleted, such as Delete 1 organization or Delete 2 organizations.

When one organization remains, the dashboard opens it and records the consolidation in its audit log. Accounts with passwords remain, but nobody is added to the retained organization automatically. An account without a password is deleted when it belonged only to deleted organizations. Invite retained users who no longer belong to an organization. If consolidation stops part-way, run it again to remove the remaining organizations.

Verify password sign-in and invitation flows before continuing.

Upgrade the Gateways​

Upgrade each gateway after the control plane passes verification. Follow the procedure for how the gateway was deployed: with the Helm chart or as a Docker container. Keep the complete recovery set until the control plane and every gateway have operated normally through the observation period defined by your change policy.

To enable a budget time zone other than UTC, first finish upgrading every control-plane replica to v1.12.0 or later. During a rolling upgrade, wait until every replica runs the new version. Then finish upgrading every gateway in the organization to v1.12.0 or later. Only then change the budget time zone.

When you change the organization to a non-UTC zone, the control plane checks all its environments, even if there are no blocking budgets. It rejects the change with HTTP 422 DP_INCOMPATIBLE if a gateway on a supported release that only handles UTC has reported a heartbeat in the past five minutes. After a non-UTC zone is set, creating or updating a blocking budget checks only the environments that budget covers. Warn-only budgets and switching the organization back to UTC do not trigger this time zone check.

Upgrade a Helm Gateway​

Review each gateway release's values before starting its rollout:

Existing configurationAction
Application settings in extraEnvVarsMove them to config, configSecrets, or rateLimit.redis. For example, move AISIX_OBSERVABILITY__LOG_LEVEL to config.observability.log_level.
AISIX_CONFIG_PATH overrideLeave it in place for the version upgrade. Remove it after verification by following the gateway cleanup procedure.
AISIX_RATELIMIT__REDIS__URL overrideLeave it in place only when rateLimit.backend is redis and either rateLimit.redis.url or rateLimit.redis.existingSecret is configured. Remove it after verification.

The chart refuses configuration keys that it owns directly, such as listener addresses and the control-plane connection. Store Redis credentials in a Secret rather than under config. See Set Any Other Gateway Configuration.

After the control plane passes verification, follow Upgrade a Gateway on Kubernetes for every gateway release. Use the same target version as the control-plane chart. The first upgrade that renders the gateway configuration file replaces every gateway pod, even when the settings themselves are unchanged.

Upgrade a Connected Docker Gateway​

Follow Upgrade a Connected Docker Gateway for each gateway started from the Docker tab in Data planes. The shared guide applies to AISIX Enterprise and AISIX Cloud. It preserves custom container settings, replaces gateways one at a time, verifies readiness and traffic, and includes the matching rollback procedure.

Roll Back​

Roll back in the reverse order: gateways first, then the control plane.

A control-plane rollback restores the complete pre-upgrade recovery set, not only the images. The target release has already migrated the database, so restore the matching database, secrets and master keys, deployment configuration, and previous software version together.

Roll back each gateway before restoring the control plane:

  • For a Helm gateway, follow Roll Back with its pre-upgrade chart revision.
  • For a connected Docker gateway, follow Roll Back with the pre-upgrade version and every recorded container option restored.

For a package installation, restore the recovery set and previous package, then acknowledge the intentional downgrade:

AISIX_ALLOW_DOWNGRADE=1 ./run.sh

Confirm that the startup output reports the version you intended to restore.

For a Helm installation, follow Roll Back a Helm Control Plane Upgrade. It stops both database writers, restores the complete recovery set, and rolls the workloads back without restarting the newer release against the restored database.

Clean Up After the Rollback Window​

Complete only the cleanup that applies to the release you upgraded from.

Remove CREATEROLE and BYPASSRLS​

After the rollback window closes, the database connection role no longer needs CREATEROLE or BYPASSRLS:

ALTER ROLE aisix NOCREATEROLE NOBYPASSRLS;

Replace aisix with the configured connection role.

Remove the cp_api_app Role​

The control plane no longer uses cp_api_app but does not drop it, because another control-plane database on the same PostgreSQL cluster may still use it. Once no database needs the role, run the following in every database where it has grants:

REASSIGN OWNED BY cp_api_app TO aisix;
DROP OWNED BY cp_api_app;

Replace aisix with that database's owner. Then drop the role once:

DROP ROLE cp_api_app;

DROP ROLE needs a superuser or a role with CREATEROLE; on PostgreSQL 16 and later, that role also needs ADMIN OPTION on cp_api_app.

AISIX Enterprise Situations That Are Not Supported​

  • Adding a gateway older than the environment's existing configuration already requires. The mixed-version window covers gateways moving forward. Do not add an older gateway to an environment whose saved configuration already depends on a newer release; that gateway would not load the configuration.
  • Upgrading gateways before the AISIX Enterprise control plane. Upgrade the control plane before its connected gateways.
  • Connecting a gateway older than 1.9.0. The control plane does not check saved configuration against such a gateway, and the gateway may fail to load it. Upgrade it to 1.9.0 or later.
  • Upgrading a control plane older than 1.9.0. See Plan the Upgrade.