Skip to content

Commit 4562f81

Browse files
committed
Merge remote-tracking branch 'origin/release-v2-dev' into feat/support-admin-api-mode
# Conflicts: # .github/workflows/apisix-e2e-test.yml
2 parents fb12bf4 + ecc8016 commit 4562f81

File tree

9 files changed

+184
-13
lines changed

9 files changed

+184
-13
lines changed

api/v2/apisixtls_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type ApisixTlsStatus = ApisixStatus
3636

3737
// +kubebuilder:object:root=true
3838
// +kubebuilder:subresource:status
39-
// +kubebuilder:resource:shortName=atls
39+
// +kubebuilder:resource:shortName=atls,path=apisixtlses
4040

4141
// ApisixTls is the Schema for the apisixtls API.
4242
type ApisixTls struct {

config/crd/bases/apisix.apache.org_apisixtls.yaml renamed to config/crd/bases/apisix.apache.org_apisixtlses.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.17.2
7-
name: apisixtls.apisix.apache.org
7+
name: apisixtlses.apisix.apache.org
88
spec:
99
group: apisix.apache.org
1010
names:
1111
kind: ApisixTls
1212
listKind: ApisixTlsList
13-
plural: apisixtls
13+
plural: apisixtlses
1414
shortNames:
1515
- atls
1616
singular: apisixtls

config/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resources:
1010
- bases/apisix.apache.org_apisixroutes.yaml
1111
- bases/apisix.apache.org_apisixconsumers.yaml
1212
- bases/apisix.apache.org_apisixglobalrules.yaml
13-
- bases/apisix.apache.org_apisixtls.yaml
13+
- bases/apisix.apache.org_apisixtlses.yaml
1414
- bases/apisix.apache.org_apisixupstreams.yaml
1515
- bases/apisix.apache.org_apisixpluginconfigs.yaml
1616
# +kubebuilder:scaffold:crdkustomizeresource

config/rbac/role.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ rules:
2929
- apisixglobalrules
3030
- apisixpluginconfigs
3131
- apisixroutes
32-
- apisixtls
32+
- apisixtlses
3333
- apisixupstreams
3434
- backendtrafficpolicies
3535
- consumers
@@ -47,7 +47,7 @@ rules:
4747
- apisixglobalrules/status
4848
- apisixpluginconfigs/status
4949
- apisixroutes/status
50-
- apisixtls/status
50+
- apisixtlses/status
5151
- apisixupstreams/status
5252
- backendtrafficpolicies/status
5353
- consumers/status
277 KB
Loading

docs/upgrade-guide.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# APISIX Ingress Controller Upgrade Guide
2+
3+
## Upgrading from 1.x.x to 2.0.0: Key Changes and Considerations
4+
5+
This document outlines the major updates, configuration compatibility changes, API behavior differences, and critical considerations when upgrading the APISIX Ingress Controller from version 1.x.x to 2.0.0. Please read carefully and assess the impact on your existing system before proceeding with the upgrade.
6+
7+
### APISIX Version Dependency (Data Plane)
8+
9+
The `apisix-standalone` mode is supported only with **APISIX 3.13.0**. When using this mode, it is mandatory to upgrade the data plane APISIX instance along with the Ingress Controller.
10+
11+
### Architecture Changes
12+
13+
#### Architecture in 1.x.x
14+
15+
There were two main deployment architectures in 1.x.x:
16+
17+
| Mode | Description | Issue |
18+
| -------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
19+
| Admin API Mode | Runs a separate etcd instance, with APISIX Admin API managing data plane configuration | Complex to deploy; high maintenance overhead for etcd |
20+
| Mock-ETCD Mode | APISIX and the Ingress Controller are deployed in the same Pod, mocking etcd endpoints | Stateless Ingress cannot persist revision info; may lead to data inconsistency |
21+
22+
#### Architecture in 2.0.0
23+
24+
![upgrade to 2.0.0 architecture](./assets/images/upgrade-to-architecture.png)
25+
26+
##### Mock-ETCD Mode Deprecated
27+
28+
The mock-etcd architecture is no longer supported. This mode introduced significant reliability issues: stateless ingress controllers could not persist revision metadata, leading to memory pollution in the data plane and data inconsistencies.
29+
30+
The following configuration block has been removed:
31+
32+
```yaml
33+
etcdserver:
34+
enabled: false
35+
listen_address: ":12379"
36+
prefix: /apisix
37+
ssl_key_encrypt_salt: edd1c9f0985e76a2
38+
```
39+
40+
##### Controller-Only Configuration Source
41+
42+
In 2.0.0, all data plane configurations must originate from the Ingress Controller. Configurations via Admin API or any external methods are no longer supported and will be ignored or may cause errors.
43+
44+
### Ingress Configuration Changes
45+
46+
#### Configuration Path Changes
47+
48+
| Old Path | New Path |
49+
| ------------------------ | -------------------- |
50+
| `kubernetes.election_id` | `leader_election_id` |
51+
52+
#### Removed Configuration Fields
53+
54+
| Configuration Path | Description |
55+
| -------------------- | ---------------------------------------- |
56+
| `kubernetes.*` | Multi-namespace control / sync interval |
57+
| `plugin_metadata_cm` | Plugin metadata ConfigMap |
58+
| `log_rotation_*` | Log rotation settings |
59+
| `apisix.*` | Static Admin API configuration |
60+
| `etcdserver.*` | Configuration for mock-etcd (deprecated) |
61+
62+
#### Example: Legacy Configuration Removed in 2.0.0
63+
64+
```yaml
65+
apisix:
66+
admin_api_version: v3
67+
default_cluster_base_url: "http://127.0.0.1:9180/apisix/admin"
68+
default_cluster_admin_key: ""
69+
default_cluster_name: "default"
70+
```
71+
72+
#### New Configuration via `GatewayProxy` CRD
73+
74+
From version 2.0.0, the data plane must be connected via the `GatewayProxy` CRD:
75+
76+
```yaml
77+
apiVersion: networking.k8s.io/v1
78+
kind: IngressClass
79+
metadata:
80+
name: apisix
81+
spec:
82+
controller: "apisix.apache.org/apisix-ingress-controller"
83+
parameters:
84+
apiGroup: "apisix.apache.org"
85+
kind: "GatewayProxy"
86+
name: "apisix-proxy-config"
87+
namespace: "default"
88+
scope: "Namespace"
89+
---
90+
apiVersion: apisix.apache.org/v1alpha1
91+
kind: GatewayProxy
92+
metadata:
93+
name: apisix-proxy-config
94+
namespace: default
95+
spec:
96+
provider:
97+
type: ControlPlane
98+
controlPlane:
99+
endpoints:
100+
- https://127.0.0.1:9180
101+
auth:
102+
type: AdminKey
103+
adminKey:
104+
value: ""
105+
```
106+
107+
### API Changes
108+
109+
#### `ApisixUpstream`
110+
111+
Due to current limitations in the ADC (API Definition Controller) component, the following fields are not yet supported:
112+
113+
* `spec.discovery`: Service Discovery
114+
* `spec.healthCheck`: Health Checking
115+
116+
More details: [ADC Backend Differences](https://github.com/api7/adc/blob/2449ca81e3c61169f8c1e59efb4c1173a766bce2/libs/backend-apisix-standalone/README.md#differences-in-upstream)
117+
118+
#### Limited Support for Ingress Annotations
119+
120+
Ingress annotations used in version 1.x.x are not fully supported in 2.0.0. If your existing setup relies on any of the following annotations, validate compatibility or consider delaying the upgrade.
121+
122+
| Ingress Annotations |
123+
| ------------------------------------------------------ |
124+
| `k8s.apisix.apache.org/use-regex` |
125+
| `k8s.apisix.apache.org/enable-websocket` |
126+
| `k8s.apisix.apache.org/plugin-config-name` |
127+
| `k8s.apisix.apache.org/upstream-scheme` |
128+
| `k8s.apisix.apache.org/upstream-retries` |
129+
| `k8s.apisix.apache.org/upstream-connect-timeout` |
130+
| `k8s.apisix.apache.org/upstream-read-timeout` |
131+
| `k8s.apisix.apache.org/upstream-send-timeout` |
132+
| `k8s.apisix.apache.org/enable-cors` |
133+
| `k8s.apisix.apache.org/cors-allow-origin` |
134+
| `k8s.apisix.apache.org/cors-allow-headers` |
135+
| `k8s.apisix.apache.org/cors-allow-methods` |
136+
| `k8s.apisix.apache.org/enable-csrf` |
137+
| `k8s.apisix.apache.org/csrf-key` |
138+
| `k8s.apisix.apache.org/http-to-https` |
139+
| `k8s.apisix.apache.org/http-redirect` |
140+
| `k8s.apisix.apache.org/http-redirect-code` |
141+
| `k8s.apisix.apache.org/rewrite-target` |
142+
| `k8s.apisix.apache.org/rewrite-target-regex` |
143+
| `k8s.apisix.apache.org/rewrite-target-regex-template` |
144+
| `k8s.apisix.apache.org/enable-response-rewrite` |
145+
| `k8s.apisix.apache.org/response-rewrite-status-code` |
146+
| `k8s.apisix.apache.org/response-rewrite-body` |
147+
| `k8s.apisix.apache.org/response-rewrite-body-base64` |
148+
| `k8s.apisix.apache.org/response-rewrite-add-header` |
149+
| `k8s.apisix.apache.org/response-rewrite-set-header` |
150+
| `k8s.apisix.apache.org/response-rewrite-remove-header` |
151+
| `k8s.apisix.apache.org/auth-uri` |
152+
| `k8s.apisix.apache.org/auth-ssl-verify` |
153+
| `k8s.apisix.apache.org/auth-request-headers` |
154+
| `k8s.apisix.apache.org/auth-upstream-headers` |
155+
| `k8s.apisix.apache.org/auth-client-headers` |
156+
| `k8s.apisix.apache.org/allowlist-source-range` |
157+
| `k8s.apisix.apache.org/blocklist-source-range` |
158+
| `k8s.apisix.apache.org/http-allow-methods` |
159+
| `k8s.apisix.apache.org/http-block-methods` |
160+
| `k8s.apisix.apache.org/auth-type` |
161+
| `k8s.apisix.apache.org/svc-namespace` |
162+
163+
### Summary
164+
165+
| Category | Description |
166+
| ---------------- | ---------------------------------------------------------------------------------------------------- |
167+
| Architecture | The `mock-etcd` component has been removed. Configuration is now centralized through the Controller. |
168+
| Configuration | Static configuration fields have been removed. Use `GatewayProxy` CRD to configure the data plane. |
169+
| Data Plane | Requires APISIX version 3.13.0 running in `standalone` mode. |
170+
| API | Some fields in `Ingress Annotations` and `ApisixUpstream` are not yet supported. |
171+
| Upgrade Strategy | Blue-green deployment or canary release is recommended before full switchover. |

internal/manager/controllers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ import (
3838
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixglobalrules,verbs=get;list;watch
3939
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixpluginconfigs,verbs=get;list;watch
4040
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixroutes,verbs=get;list;watch
41-
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixtls,verbs=get;list;watch
41+
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixtlses,verbs=get;list;watch
4242
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixupstreams,verbs=get;list;watch
4343

4444
// CustomResourceDefinition v2 status
4545
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixconsumers/status,verbs=get;update
4646
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixglobalrules/status,verbs=get;update
4747
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixpluginconfigs/status,verbs=get;update
4848
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixroutes/status,verbs=get;update
49-
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixtls/status,verbs=get;update
49+
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixtlses/status,verbs=get;update
5050
// +kubebuilder:rbac:groups=apisix.apache.org,resources=apisixupstreams/status,verbs=get;update
5151

5252
// CustomResourceDefinition

internal/provider/adc/executor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ func (e *DefaultADCExecutor) buildCmdError(runErr error, stdout, stderr []byte)
112112

113113
func (e *DefaultADCExecutor) handleOutput(output []byte) error {
114114
var result adctypes.SyncResult
115-
if index := strings.IndexByte(string(output), '{'); index > 0 {
116-
log.Warnf("extra output: %s", string(output[:index]))
117-
output = output[index:]
115+
log.Debugf("adc output: %s", string(output))
116+
if lines := bytes.Split(output, []byte{'\n'}); len(lines) > 0 {
117+
output = lines[len(lines)-1]
118118
}
119119
if err := json.Unmarshal(output, &result); err != nil {
120120
log.Errorw("failed to unmarshal adc output",

test/e2e/framework/manifests/ingress.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ rules:
114114
- apisixglobalrules
115115
- apisixpluginconfigs
116116
- apisixroutes
117-
- apisixtls
117+
- apisixtlses
118118
- apisixupstreams
119119
- backendtrafficpolicies
120120
- consumers
@@ -132,7 +132,7 @@ rules:
132132
- apisixglobalrules/status
133133
- apisixpluginconfigs/status
134134
- apisixroutes/status
135-
- apisixtls/status
135+
- apisixtlses/status
136136
- apisixupstreams/status
137137
- backendtrafficpolicies/status
138138
- consumers/status

0 commit comments

Comments
 (0)