Skip to content

Commit 3afb60a

Browse files
authored
Merge 895f935 into 0ecc5c1
2 parents 0ecc5c1 + 895f935 commit 3afb60a

File tree

5 files changed

+233
-43
lines changed

5 files changed

+233
-43
lines changed

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ This project is part of [FIWARE](https://www.fiware.org/). For more information
2626
- [Deployment with Helm](#deployment-with-helm)
2727
- [Testing](#testing)
2828
- [APISIX Deployment Modes](#apisix-deployment-modes)
29+
- [Comparison Table](#comparison-table)
30+
- [1. With ETCD and with the Ingress Controller](#1-with-etcd-and-with-the-ingress-controller)
31+
- [2. With ETCD and without the Ingress Controller](#2-with-etcd-and-without-the-ingress-controller)
32+
- [3. Without ETCD and with the Ingress Controller](#3-without-etcd-and-with-the-ingress-controller)
33+
- [4. Without ETCD and without the Ingress Controller](#4-without-etcd-and-without-the-ingress-controller)
2934
- [Values](#values)
3035
- [How to contribute](#how-to-contribute)
3136
- [License](#license)
@@ -125,6 +130,106 @@ the [test-scenarios](./it/src/test/resources/it/mvds_basic.feature) against it.
125130

126131
APISIX can operate in four distinct deployment modes. Each mode determines how routes are stored, managed, and persisted, as well as which components are responsible for maintaining the routing configuration.
127132

133+
### Comparison Table
134+
135+
| Mode | ETCD | Ingress Controller | Route Source | Persistence | Notes |
136+
| -------------------------------------------------- | ---- | ------------------ | ------------------------------------------ | ------------------------------ | ------------------------------------------ |
137+
| **1. With ETCD and with Ingress Controller** | ✔️ | ✔️ | APISIX CRDs, Kubernetes Ingress, Admin API | ✔️ Persisted in ETCD | Recommended for Kubernetes-native setups |
138+
| **2. With ETCD and without Ingress Controller** | ✔️ || Admin API only | ✔️ Persisted in ETCD | Chart-defined routes are *not* initialized |
139+
| **3. Without ETCD and with Ingress Controller** || ✔️ | APISIX CRDs, Kubernetes Ingress, Admin API | ❌ In-memory only | Requires at least one route to start |
140+
| **4. Without ETCD and without Ingress Controller** ||| Static ConfigMap (`apisix.yaml`) | ✔️ Persisted only in ConfigMap | **Under development**; installation may fail but upgrades will work |
141+
142+
---
143+
144+
### 1. With ETCD and with the Ingress Controller
145+
146+
In this mode, APISIX persists all route definitions in ETCD. Routes may be defined via APISIX CRDs, standard Kubernetes Ingress resources, or the Admin API.
147+
Because the configuration is stored in ETCD, all routes—including those created through the Admin API—will **remain available after restarts**.
148+
149+
```yaml
150+
apisix:
151+
ingress-controller:
152+
enabled: true
153+
apisix:
154+
deployment:
155+
role: traditional
156+
role_traditional:
157+
config_provider: yaml
158+
standalone:
159+
existingConfigMap: ""
160+
etcd:
161+
enabled: true
162+
```
163+
164+
---
165+
166+
### 2. With ETCD and without the Ingress Controller
167+
168+
In this configuration, ETCD persists the routes, but no Ingress Controller is available to manage them. As a result, routes can **only** be created or updated using the APISIX Admin API.
169+
Chart-defined routes are **not** initialized automatically.
170+
171+
```yaml
172+
apisix:
173+
ingress-controller:
174+
enabled: false
175+
apisix:
176+
deployment:
177+
role: traditional
178+
role_traditional:
179+
config_provider: yaml
180+
etcd:
181+
enabled: true
182+
```
183+
184+
---
185+
186+
### 3. Without ETCD and with the Ingress Controller
187+
188+
When ETCD is disabled, APISIX loads all routes from APISIX CRDs and stores them in memory. The Ingress Controller continuously synchronizes APISIX with these CRDs.
189+
Although the Admin API can still modify routes, such changes **will not persist across restarts**.
190+
Kubernetes Ingress objects may also be used to define new routes.
191+
192+
> [!WARNING]
193+
> APISIX requires at least one route to exist for the service to start correctly.
194+
195+
```yaml
196+
apisix:
197+
ingress-controller:
198+
enabled: true
199+
apisix:
200+
deployment:
201+
role: traditional
202+
role_traditional:
203+
config_provider: yaml
204+
standalone:
205+
existingConfigMap: ""
206+
etcd:
207+
enabled: false
208+
```
209+
210+
---
211+
212+
### 4. Without ETCD and without the Ingress Controller
213+
214+
In this mode, routes are defined statically within the `apisix-routes` ConfigMap. APISIX loads these routes at startup, and the configuration remains unchanged unless the ConfigMap or Helm values are manually updated.
215+
This mode is suitable for simple or fully static environments.
216+
217+
```yaml
218+
apisix:
219+
ingress-controller:
220+
enabled: false
221+
apisix:
222+
deployment:
223+
mode: standalone
224+
role: data_plane
225+
role_data_plane:
226+
config_provider: "yaml"
227+
standalone:
228+
existingConfigMap: "apisix-routes"
229+
etcd:
230+
enabled: false
231+
```
232+
128233
For mor information, please check the oficial APISIX documentation on [deployment modes](https://apisix.apache.org/docs/apisix/deployment-modes/) and the [APISIX Helm Chart documentation](https://github.com/apache/apisix-helm-chart/tree/master) for configuration details.
129234

130235
<!-- BEGIN HELM DOCS -->

charts/odrl-authorization/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apiVersion: v2
22
name: odrl-authorization
33
description: Umbrella chart to deploy FIWARE ODRL Authorization
44
type: application
5-
version: 2.0.0
5+
version: 2.1.0
66
dependencies:
77
# authorization
88
- name: odrl-pap
99
condition: odrl-pap.enabled
10-
version: 2.3.2
10+
version: 2.9.1
1111
repository: https://fiware.github.io/helm-charts
1212
- name: apisix
1313
condition: apisix.enabled
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{ $ingressConfig := (index .Values.apisix "ingress-controller") }}
2+
{{- if $ingressConfig.enabled }}
3+
{{ $ingressClassName := default "apisix" $ingressConfig.config.kubernetes.ingressClass }}
4+
{{- range $idx, $route := .Values.apisix.routes }}
5+
{{ $routeName := default (printf "%s-%d" ($route.host | replace "." "-") $idx) $route.name }}
6+
{{ $upstreamName := printf "%s-%s" $routeName "upstream" }}
7+
apiVersion: apisix.apache.org/v2
8+
kind: ApisixRoute
9+
metadata:
10+
name: {{ printf "%s-%s" $routeName "route" }}
11+
namespace: {{ default $.Release.Namespace $route.namespace | quote }}
12+
spec:
13+
ingressClassName: {{ $ingressClassName }}
14+
http:
15+
- name: {{ printf "%s-%s" $routeName "route" }}
16+
match:
17+
hosts:
18+
- {{ $route.host }}
19+
paths:
20+
- {{ $route.uri }}
21+
{{- range $key, $value := $route.upstream.nodes }}
22+
{{- $url := include "odrl-auth.parseURL" $key | fromYaml }}
23+
backends:
24+
- serviceName: {{ $url.host }}
25+
servicePort: {{ $url.port }}
26+
weight: {{ $value }}
27+
{{- end }}
28+
{{- if $route.plugins }}
29+
plugins:
30+
{{- range $key, $value := $route.plugins }}
31+
- name: {{ $key }}
32+
enable: true
33+
config:
34+
{{- $value | toYaml | nindent 10 }}
35+
{{- end }}
36+
{{- end }}
37+
---
38+
{{- end }}
39+
{{- else }}
40+
apiVersion: v1
41+
kind: ConfigMap
42+
metadata:
43+
name: apisix-routes
44+
namespace: {{ $.Release.Namespace | quote }}
45+
labels:
46+
{{- include "odrl-auth.labels" . | nindent 4 }}
47+
data:
48+
apisix.yaml: |-
49+
routes:
50+
{{- if .Values.apisix.catchAllRoute.enabled }}
51+
- uri: /*
52+
upstream:
53+
nodes:
54+
{{ .Values.apisix.catchAllRoute.upstream.url}}: 1
55+
type: roundrobin
56+
plugins:
57+
openid-connect:
58+
client_id: {{ .Values.apisix.catchAllRoute.oidc.clientId }}
59+
client_secret: the-secret
60+
bearer_only: true
61+
use_jwks: true
62+
discovery: {{ .Values.apisix.catchAllRoute.oidc.discoveryEndpoint }}
63+
opa:
64+
host: {{ required "Open Agent Policy host is required when catchAllRoute is enabled" .Values.apisix.catchAllRoute.opa.host}}
65+
policy: policy/main
66+
with_body: true
67+
{{- end }}
68+
{{- if .Values.apisix.routes }}
69+
{{- .Values.apisix.routes | toYaml | nindent 6 }}
70+
{{- end }}
71+
#END
72+
{{- end }}

charts/odrl-authorization/values.yaml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apisix:
77
enabled: true
88
ingress-controller:
99
# -- Enable the ingress controller pod to read Kubernetes Ingress resources. See [chart documentation](https://artifacthub.io/packages/helm/apisix/apisix-ingress-controller) for more details
10-
enabled: true
10+
enabled: false
1111
gatewayProxy:
1212
# -- Controls whether to create a default GatewayProxy custom resource.
1313
createDefault: true
@@ -25,25 +25,16 @@ apisix:
2525
#
2626
# ref: https://apisix.apache.org/docs/apisix/deployment-modes/
2727
role: "data_plane"
28-
role_traditional:
28+
role_data_plane:
2929
# enum: etcd, yaml
3030
config_provider: "yaml"
3131
# -- Standalone rules configuration
3232
#
3333
# ref: https://apisix.apache.org/docs/apisix/deployment-modes/#standalone
3434
standalone:
35-
# -- Rules which are set to the default apisix.yaml configmap.
36-
# If apisix.deployment.standalone.existingConfigMap is empty, these are used.
37-
config: |
38-
routes:
39-
- uri: /hi
40-
upstream:
41-
nodes:
42-
"127.0.0.1:1980": 1
43-
type: roundrobin
4435
# -- Specifies the name of the ConfigMap that contains the rule configurations.
4536
# The configuration must be set to the key named `apisix.yaml` in the configmap.
46-
existingConfigMap: ""
37+
existingConfigMap: "apisix-routes"
4738
admin:
4839
enabled: true
4940
customPlugins:
@@ -108,6 +99,32 @@ apisix:
10899
host: 'http://localhost:8181'
109100
policy: policy/main
110101
with_body: true
102+
# -- (dict) Configuration of routes for apisix
103+
# @raw
104+
#
105+
# ```yaml
106+
# uri: /*
107+
# host: host-name-test
108+
# type: Service
109+
# namespace: super-ns # release namespace by default
110+
# upstream:
111+
# nodes:
112+
# data-service-test:9090: 1
113+
# type: roundrobin
114+
# plugins:
115+
# openid-connect:
116+
# bearer_only: true
117+
# use_jwks: true
118+
# client_id: data-service
119+
# client_secret: unused
120+
# discovery: https://verifier:8080/services/data-service/.well-known/openid-configuration
121+
# opa:
122+
# host: "http://localhost:8181"
123+
# policy: policy/main
124+
# with_body: true
125+
# ```
126+
#
127+
routes: []
111128
etcd:
112129
enabled: true
113130

deploy/helmfile.yaml

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,37 +81,31 @@ releases:
8181
type: apisix-standalone
8282
apisix:
8383
deployment:
84+
role: "traditional"
85+
role_traditional:
86+
config_provider: "yaml"
8487
standalone:
85-
config: |
86-
routes:
87-
- host: apisix.127.0.0.1.nip.io
88-
uri: "/*"
89-
upstream:
90-
nodes:
91-
mockserver:8080: 1
92-
type: roundrobin
93-
plugins:
94-
openid-connect:
95-
client_id: ""
96-
client_secret: the-secret
97-
bearer_only: true
98-
use_jwks: true
99-
discovery: http://mockserver:8080/.well-known/openid-configuration
100-
opa:
101-
host: http://localhost:8181
102-
policy: policy/main
103-
with_body: true
104-
- host: pap.127.0.0.1.nip.io
105-
uri: /*
106-
upstream:
107-
nodes:
108-
odrl-pap:8080: 1
88+
existingConfigMap: ""
89+
routes:
90+
- host: apisix.127.0.0.1.nip.io
91+
uri: "/*"
92+
upstream:
93+
nodes:
94+
mockserver:8080: 1
95+
type: roundrobin
96+
plugins:
97+
openid-connect:
98+
client_id: ""
99+
client_secret: the-secret
100+
bearer_only: true
101+
use_jwks: true
102+
discovery: http://mockserver:8080/.well-known/openid-configuration
103+
opa:
104+
host: http://localhost:8181
105+
policy: policy/main
106+
with_body: true
109107
ingress:
110-
enabled: true
111-
hostname: apisix.127.0.0.1.nip.io
112-
hosts:
113-
- host: apisix.127.0.0.1.nip.io
114-
paths: ["/"]
108+
enabled: false
115109
service:
116110
http:
117111
nodePort: 30080
@@ -138,6 +132,8 @@ releases:
138132
key: password
139133
ingress:
140134
enabled: true
135+
annotations:
136+
kubernetes.io/ingress.class: "apisix"
141137
hosts:
142138
- host: pap.127.0.0.1.nip.io
143139
paths:

0 commit comments

Comments
 (0)