title: Upgrade Guide keywords:
APISIX adheres to semantic versioning.
Upgrading to APISIX 3.0.0 is a major version upgrade and we recommend that you upgrade to 2.15.x first and then to 3.0.0.
Before upgrading, please check the 3.0.0-beta and 3.0.0 in the Change section for incompatible changes and major updates for version 3.0.0.
The alpine-based image is no longer supported, so if you are using the alpine image, you will need to replace it with a debian/centos-based image.
Currently, we provide:
3.0.0 makes major updates to the deployment model, as follows:
traditional mode in the deployment mode and update the configuration file, please refer to TraditionalIf you use the provided binary packages (Debian and RHEL), or images, then they already bundle all the necessary dependencies for APISIX and you can skip this section.
Some features of APISIX require additional NGINX modules to be introduced in OpenResty. To use these features, you need to build a custom OpenResty distribution (APISIX-Base). You can build your own APISIX-Base environment by referring to the code in api7/apisix-build-tools.
If you want APISIX to run on native OpenResty, then only OpenResty 1.19.3.2 and above are supported.
APISIX is configured to override the default conf/config-default.yaml with the contents of custom conf/config.yaml, or if a configuration does not exist in conf/config.yaml, then use the configuration in conf/config-default.yaml. In 3.0.0, we adjusted conf/config-default.yaml.
From version 2.15.x to 3.0.0, the location of some configuration in conf/config-default.yaml has been moved. If you are using these configuration, then you need to move them to the new location.
Adjustment content:
config_center is now implemented by config_provider under deploymentetcd field is moved to deployment.admin field under deploymentYou can find the exact new location of these configuration in conf/config-default.yaml.
Some configuration have been removed in 3.0.0 and replaced with new configuration. If you are using these configuration, then you need to update them to the new configuration.
Adjustment content:
enable_http2 and listen_port from apisix.ssl and replaced with apisix.ssl.listenIf you have this configuration in conf/config.yaml like:
ssl: enable_http2: true listen_port: 9443
Then you need to change it to:
ssl: listen: - port: 9443 enable_http2: true
nginx_config.http.lua_shared_dicts and replaced with nginx_config.http.custom_lua_shared_dict, this configuration is used to declare custom shared memory blocks. If you have this configuration in conf/config.yaml like:nginx_config: http: lua_shared_dicts: my_dict: 1m
Then you need to change it to:
nginx_config: http: custom_lua_shared_dict: my_dict: 1m
etcd.health_check_retry and replaced with deployment.etcd.startup_retry, this configuration is used to configure the number of retries when APISIX starts to connect to etcd. If you have this configuration in conf/config.yaml like:etcd: health_check_retry: 2
Then you need to change it to:
deployment: etcd: startup_retry: 2
apisix.port_admin and replaced with deployment.admin.admin_listen, this configuration is used to configure the Admin API listening port. If you have this configuration in conf/config.yaml like:apisix: port_admin: 9180
Then you need to change it to:
deployment: apisix: admin_listen: ip: 127.0.0.1 # replace with the actual IP exposed port: 9180
enable_cpu_affinity to false. Reason: More and more users are deploying APISIX via containers. Since Nginx's worker_cpu_affinity does not count against the cgroup, enabling worker_cpu_affinity by default can affect APISIX behavior, for example, if multiple instances are bound to a single CPU. To avoid this problem, we disable the enable_cpu_affinity option by default in conf/config-default.yaml.apisix.real_ip_header and replaced with nginx_config.http.real_ip_headerIf you need to backup and restore your data, you can use the backup and restore function of ETCD, refer to etcdctl snapshot.
In 3.0.0, we have adjusted some of the data structures that affect the routing, upstream, and plugin data of APISIX. The data is not fully compatible between version 3.0.0 and version 2.15.x. You cannot use APISIX version 3.0.0 to connect directly to the ETCD cluster used by APISIX version 2.15.x.
In order to keep the data compatible, there are two ways, for reference only.
Adjustment content:
disable of the plugin configuration under _metadisable indicates the enable/disable status of the plugin
If such a data structure exists in ETCD
{ "plugins":{ "limit-count":{ ... // plugin configuration "disable":true } } }
In 3.0.0, the data structure of this plugin should be transformed to
{ "plugins":{ "limit-count":{ ... // plugin configuration "_meta":{ "disable":true } } } }
Note: disable is the meta-configuration of the plugin, and this adjustment takes effect for all plugin configurations, not just the limit-count plugin.
service_protocol from the Route, and replaced it with upstream.schemeIf such a data structure exists in ETCD
{ "uri":"/hello", "service_protocol":"grpc", "upstream":{ "type":"roundrobin", "nodes":{ "127.0.0.1:1980":1 } } }
In 3.0.0, the data structure of this plugin should be transformed to
{ "uri":"/hello", "upstream":{ "type":"roundrobin", "scheme":"grpc", "nodes":{ "127.0.0.1:1980":1 } } }
audience field from authz-keycloak, and replaced it with client_idIf such a data structure of authz-keycloak plugin exists in ETCD
{ "plugins":{ "authz-keycloak":{ ... // plugin configuration "audience":"Client ID" } } }
In 3.0.0, the data structure of this plugin should be transformed to
{ "plugins":{ "authz-keycloak":{ ... // plugin configuration "client_id":"Client ID" } } }
Removed upstream field from mqtt-proxy, and configure upstream outside the plugin and reference it in the plugin
If such a data structure of mqtt-proxy plugin exists in ETCD
{ "remote_addr":"127.0.0.1", "plugins":{ "mqtt-proxy":{ "protocol_name":"MQTT", "protocol_level":4, "upstream":{ "ip":"127.0.0.1", "port":1980 } } } }
In 3.0.0, the data structure of this plugin should be transformed to
{ "remote_addr":"127.0.0.1", "plugins":{ "mqtt-proxy":{ "protocol_name":"MQTT", "protocol_level":4 } }, "upstream":{ "type":"chash", "key":"mqtt_client_id", "nodes":[ { "host":"127.0.0.1", "port":1980, "weight":1 } ] } }
Removed max_retry_times and retry_interval fields from syslog, and replaced them with max_retry_count and retry_delay
If such a data structure of syslog plugin exists in ETCD
{ "plugins":{ "syslog":{ "max_retry_times":1, "retry_interval":1, ... // other configuration } } }
In 3.0.0, the data structure of this plugin should be transformed to
{ "plugins":{ "syslog":{ "max_retry_count":1, "retry_delay":1, ... // other configuration } } }
The scheme field has been removed from proxy-rewrite, and the scheme field has been added to upstream
If such a data structure of proxy-rewrite plugin exists in ETCD
{ "plugins":{ "proxy-rewrite":{ "scheme":"https", ... // other configuration } }, "upstream":{ "nodes":{ "127.0.0.1:1983":1 }, "type":"roundrobin" }, "uri":"/hello" }
In 3.0.0, the data structure of this plugin should be transformed to
{ "plugins":{ "proxy-rewrite":{ ... // other configuration } }, "upstream":{ "scheme":"https", "nodes":{ "127.0.0.1:1983":1 }, "type":"roundrobin" }, "uri":"/hello" }
We have made some tweaks to the Admin API that are designed to make it easier to use and more in line with RESTful design ideas.
Adjustment content:
count, action and node fields in the response body are removed and the contents of node are moved up to the root of the response bodyIn version 2.x, the response format for querying /apisix/admin/routes/1 via the Admin API is
{ "count":1, "action":"get", "node":{ "key":"\/apisix\/routes\/1", "value":{ ... // content } } }
In 3.0.0, the response format for querying the /apisix/admin/routes/1 resource via the Admin API is
{ "key":"\/apisix\/routes\/1", "value":{ ... // content } }
dir field, add a new list field to store the data of the list resources, and add a new total field to store the total number of list resourcesIn version 2.x, the response format for querying /apisix/admin/routes via the Admin API is
{ "action":"get", "count":2, "node":{ "key":"\/apisix\/routes", "nodes":[ { "key":"\/apisix\/routes\/1", "value":{ ... // content } }, { "key":"\/apisix\/routes\/2", "value":{ ... // content } } ], "dir":true } }
In 3.0.0, the response format for querying the /apisix/admin/routes resource via the Admin API is
{ "list":[ { "key":"\/apisix\/routes\/1", "value":{ ... // content } }, { "key":"\/apisix\/routes\/2", "value":{ ... // content } } ], "total":2 }
/apisix/admin/ssl/{id} to /apisix/admin/ssls/{id}In version 2.x, operating with ssl resources via the Admin API
curl -i http://{apisix_listen_address}/apisix/admin/ssl/{id}
In 3.0.0, operating with ssl resources via the Admin API
curl -i http://{apisix_listen_address}/apisix/admin/ssls/{id}
/apisix/admin/proto/{id} to /apisix/admin/protos/{id}In version 2.x, operating with proto resources via the Admin API
curl -i http://{apisix_listen_address}/apisix/admin/proto/{id}
In 3.0.0, operating with proto resources via the Admin API
curl -i http://{apisix_listen_address}/apisix/admin/protos/{id}
We also adjusted the Admin API port to 9180.