Note: Before upgrading APISIX Ingress, you need to update the corresponding CRD resource first, k8s will automatically replace it with the default CRD resource version, incompatible items will be discarded, and its configuration needs to be updated to the current version.
Before upgrading, you need to update the helm repo to ensure that the resources in the repo are up to date.
helm repo update
When the CRD exists, Helm Chart will not automatically update the CRD when upgrading or installing, so you need to update the CRD resource yourself
helm show crds apisix/apisix-ingress-controller | kubectl apply -f -
If the Helm version does not support it, you need to obtain it from the apisix-helm-chart repository. CRDs directory:
charts/apisix-ingress-controller/crds/customresourcedefinitions.yaml
kubectl apply -f https://raw.githubusercontent.com/apache/apisix-helm-chart/apisix-0.11.1/charts/apisix-ingress-controller/crds/customresourcedefinitions.yaml
Just as an example, the specific configuration needs to be modified by yourself. If you want to upgrade to a specific chart version, please add this flag --version x.x.x
.
helm upgrade apisix apisix/apisix \ --set gateway.type=NodePort \ --set ingress-controller.enabled=true \ --namespace ingress-apisix \ --set ingress-controller.config.apisix.serviceNamespace=ingress-apisix
It is recommended not to upgrade across major versions.
Compatible upgrades can be made without changing any resources.
helm upgrade apisix apisix/apisix *** # omit some configuration
The chart version corresponding to chart version 1.5:
apisix-0.11.3
apisix-ingress-controller-0.10.1
helm upgrade apisix apisix/apisix --version 0.11.3 *** # omit some configuration
The chart version corresponding to chart version 1.4:
apisix-0.10.2
apisix-ingress-controller-0.9.3
helm upgrade apisix apisix/apisix --version 0.10.2 *** # omit some configuration
Incompatible upgrade, need to change resources. ApisixRoute object(http[].backend)
has been removed in V2beta3 and needs to be converted to array(http[].backends)
. It is recommended not to upgrade across major versions.
app_namespace
is deprecated, you can use namespace_selector
instead.Apache APISIX Ingress project is a continuously actively developed project. In order to make it better, some broken changes will be added when the new version is released. For users, how to upgrade safely becomes very important.
The policy directory of this project contains these compatibility check strategies, you can use the conftest
tool to check the compatibility.
Here's a quick example.
apiVersion: apisix.apache.org/v2 kind: ApisixRoute metadata: name: httpbin-route spec: http: - name: rule1 match: hosts: - httpbin.org paths: - /ip exprs: - subject: scope: Header name: X-Foo op: Equal value: bar backends: - serviceName: httpbin servicePort: 80
It uses the spec.http.backend
field that has been removed. Save as httpbin-route.yaml.
Use conftest for compatibility check.
$ conftest test httpbin-route.yaml FAIL - httpbin-route.yaml - main - ApisixRoute/httpbin-route: rule1 field http.backend has been removed, use http.backends instead. 2 tests, 1 passed, 0 warnings, 1 failure, 0 exceptions
Incompatible parts will generate errors.