Skip to content

Commit 3334e78

Browse files
authored
docs: port docs changes (FAQ, explain port config and parameters in gateway class) (#265)
* port doc changes 2 * Fix config file
1 parent 979adee commit 3334e78

File tree

8 files changed

+276
-10
lines changed

8 files changed

+276
-10
lines changed

docs/en/latest/FAQ.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: FAQ
3+
keywords:
4+
- APISIX Ingress
5+
- Apache APISIX
6+
- Kubernetes Ingress
7+
- Gateway API
8+
- FAQ
9+
description: This document provides answers to frequently asked questions (FAQ) when using APISIX Ingress Controller.
10+
---
11+
12+
<!--
13+
#
14+
# Licensed to the Apache Software Foundation (ASF) under one or more
15+
# contributor license agreements.See the NOTICE file distributed with
16+
# this work for additional information regarding copyright ownership.
17+
# The ASF licenses this file to You under the Apache License, Version 2.0
18+
# (the "License"); you may not use this file except in compliance with
19+
# the License.You may obtain a copy of the License at
20+
#
21+
# http://www.apache.org/licenses/LICENSE-2.0
22+
#
23+
# Unless required by applicable law or agreed to in writing, software
24+
# distributed under the License is distributed on an "AS IS" BASIS,
25+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26+
# See the License for the specific language governing permissions and
27+
# limitations under the License.
28+
#
29+
-->
30+
31+
This document provides answers to frequently asked questions (FAQ) when using APISIX Ingress Controller.
32+
33+
### How does Ingress Controller handle route priority across multiple resources?
34+
35+
In APISIX, a higher value indicates a higher route priority.
36+
37+
* **Ingress:** Does not support explicit route priority. Routes created using Ingress are assigned a default priority of 0, typically the lowest.
38+
* **HTTPRoute:** Has a [38-bit priority](https://github.com/apache/apisix-ingress-controller/blob/master/internal/adc/translator/httproute.go#L428-L448). The priority calculation is dynamic and may change, making exact values difficult to predict.
39+
* **APISIXRoute:** Can be assigned an explicit priority. To have a higher priority than an HTTPRoute, the value must exceed 549,755,813,887 (2^39 − 1).
40+
41+
### How do HTTPRoute filters interact with PluginConfig CRDs?
42+
43+
APISIX maps built-in Gateway API HTTPRoute filters to specific plugins:
44+
45+
* `RequestHeaderModifier``proxy-rewrite`
46+
* `RequestRedirect``redirect`
47+
* `RequestMirror``proxy-mirror`
48+
* `URLRewrite``proxy-rewrite`
49+
* `ResponseHeaderModifier``response-rewrite`
50+
* `CORS``cors`
51+
* `ExtensionRef` → user-defined plugin reference
52+
53+
When both filters and a PluginConfig CRD are applied:
54+
55+
* If filters are applied first, PluginConfig overrides any overlapping plugin settings.
56+
* If PluginConfig is applied first, filters merge with PluginConfig settings, and overlapping fields from filters take precedence.

docs/en/latest/config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@
3838
"label": "Reference",
3939
"items": [
4040
"reference/api-reference",
41-
"reference/example"
41+
"reference/example",
42+
"reference/configuration-file"
4243
]
4344
},
4445
{
4546
"type": "doc",
4647
"id": "upgrade-guide"
4748
},
49+
{
50+
"type": "doc",
51+
"id": "FAQ"
52+
},
4853
{
4954
"type": "link",
5055
"label": "CHANGELOG",

docs/en/latest/getting-started/configure-routes.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,34 @@ spec:
8686
name: apisix-config
8787
```
8888
89+
Note that the `port` in the Gateway listener is required but ignored. This is due to limitations in the data plane: it cannot dynamically open new ports. Since the Ingress Controller does not manage the data plane deployment, it cannot automatically update the configuration or restart the data plane to apply port changes.
90+
91+
</details>
92+
93+
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration, as the IngressClass resource below is already applied with installation:
94+
95+
<details>
96+
97+
<summary>Show configuration</summary>
98+
99+
```yaml
100+
apiVersion: networking.k8s.io/v1
101+
kind: IngressClass
102+
metadata:
103+
name: apisix
104+
spec:
105+
controller: apisix.apache.org/apisix-ingress-controller
106+
parameters:
107+
apiGroup: apisix.apache.org
108+
kind: GatewayProxy
109+
name: apisix-config
110+
namespace: ingress-apisix
111+
scope: Namespace
112+
```
113+
89114
</details>
90115

91-
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration.
116+
See [Define Controller and Gateway](../reference/example.md#define-controller-and-gateway) for more information on parameters.
92117

93118
:::
94119

docs/en/latest/getting-started/key-authentication.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,34 @@ spec:
7676
name: apisix-config
7777
```
7878
79+
Note that the `port` in the Gateway listener is required but ignored. This is due to limitations in the data plane: it cannot dynamically open new ports. Since the Ingress Controller does not manage the data plane deployment, it cannot automatically update the configuration or restart the data plane to apply port changes.
80+
81+
</details>
82+
83+
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration, as the IngressClass resource below is already applied with installation:
84+
85+
<details>
86+
87+
<summary>Show configuration</summary>
88+
89+
```yaml
90+
apiVersion: networking.k8s.io/v1
91+
kind: IngressClass
92+
metadata:
93+
name: apisix
94+
spec:
95+
controller: apisix.apache.org/apisix-ingress-controller
96+
parameters:
97+
apiGroup: apisix.apache.org
98+
kind: GatewayProxy
99+
name: apisix-config
100+
namespace: ingress-apisix
101+
scope: Namespace
102+
```
103+
79104
</details>
80105

81-
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration.
106+
See [Define Controller and Gateway](../reference/example.md#define-controller-and-gateway) for more information on parameters.
82107

83108
:::
84109

docs/en/latest/getting-started/load-balancing.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,34 @@ spec:
7676
name: apisix-config
7777
```
7878
79+
Note that the `port` in the Gateway listener is required but ignored. This is due to limitations in the data plane: it cannot dynamically open new ports. Since the Ingress Controller does not manage the data plane deployment, it cannot automatically update the configuration or restart the data plane to apply port changes.
80+
81+
</details>
82+
83+
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration, as the IngressClass resource below is already applied with installation:
84+
85+
<details>
86+
87+
<summary>Show configuration</summary>
88+
89+
```yaml
90+
apiVersion: networking.k8s.io/v1
91+
kind: IngressClass
92+
metadata:
93+
name: apisix
94+
spec:
95+
controller: apisix.apache.org/apisix-ingress-controller
96+
parameters:
97+
apiGroup: apisix.apache.org
98+
kind: GatewayProxy
99+
name: apisix-config
100+
namespace: ingress-apisix
101+
scope: Namespace
102+
```
103+
79104
</details>
80105

81-
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration.
106+
See [Define Controller and Gateway](../reference/example.md#define-controller-and-gateway) for more information on parameters.
82107

83108
:::
84109

docs/en/latest/getting-started/rate-limiting.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,34 @@ spec:
7676
name: apisix-config
7777
```
7878
79+
Note that the `port` in the Gateway listener is required but ignored. This is due to limitations in the data plane: it cannot dynamically open new ports. Since the Ingress Controller does not manage the data plane deployment, it cannot automatically update the configuration or restart the data plane to apply port changes.
80+
81+
</details>
82+
83+
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration, as the IngressClass resource below is already applied with installation:
84+
85+
<details>
86+
87+
<summary>Show configuration</summary>
88+
89+
```yaml
90+
apiVersion: networking.k8s.io/v1
91+
kind: IngressClass
92+
metadata:
93+
name: apisix
94+
spec:
95+
controller: apisix.apache.org/apisix-ingress-controller
96+
parameters:
97+
apiGroup: apisix.apache.org
98+
kind: GatewayProxy
99+
name: apisix-config
100+
namespace: ingress-apisix
101+
scope: Namespace
102+
```
103+
79104
</details>
80105

81-
If you are using Ingress or APISIX custom resources, you can proceed without additional configuration.
106+
See [Define Controller and Gateway](../reference/example.md#define-controller-and-gateway) for more information on parameters.
82107

83108
:::
84109

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Configuration File
3+
slug: /reference/apisix-ingress-controller/configuration-file
4+
description: Configure the APISIX Ingress Controller using the config.yaml file, including configurations such as log settings, leader election, metrics, and sync behavior.
5+
---
6+
7+
<!--
8+
#
9+
# Licensed to the Apache Software Foundation (ASF) under one or more
10+
# contributor license agreements. See the NOTICE file distributed with
11+
# this work for additional information regarding copyright ownership.
12+
# The ASF licenses this file to You under the Apache License, Version 2.0
13+
# (the "License"); you may not use this file except in compliance with
14+
# the License. You may obtain a copy of the License at
15+
#
16+
# http://www.apache.org/licenses/LICENSE-2.0
17+
#
18+
# Unless required by applicable law or agreed to in writing, software
19+
# distributed under the License is distributed on an "AS IS" BASIS,
20+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
# See the License for the specific language governing permissions and
22+
# limitations under the License.
23+
#
24+
-->
25+
26+
The APISIX Ingress Controller uses a configuration file `config.yaml` to define core settings such as log level, leader election behavior, metrics endpoints, and sync intervals.
27+
28+
Configurations are defined in a Kubernetes ConfigMap and mounted into the controller pod as a file at runtime. To apply changes, you can update the ConfigMap and restart the controller Deployment to reload the configurations.
29+
30+
Below are all available configuration options, including their default values and usage:
31+
32+
```yaml
33+
log_level: "info" # The log level of the APISIX Ingress Controller.
34+
# The default value is "info".
35+
36+
controller_name: apisix.apache.org/apisix-ingress-controller # The controller name of the APISIX Ingress Controller,
37+
# which is used to identify the controller in the GatewayClass.
38+
# The default value is "apisix.apache.org/apisix-ingress-controller".
39+
leader_election_id: "apisix-ingress-controller-leader" # The leader election ID for the APISIX Ingress Controller.
40+
# The default value is "apisix-ingress-controller-leader".
41+
leader_election:
42+
lease_duration: 30s # lease_duration is the duration that non-leader candidates will wait
43+
# after observing a leadership renewal until attempting to acquire leadership of a
44+
# leader election.
45+
renew_deadline: 20s # renew_deadline is the time in seconds that the acting controller
46+
# will retry refreshing leadership before giving up.
47+
retry_period: 2s # retry_period is the time in seconds that the acting controller
48+
# will wait between tries of actions with the controller.
49+
disable: false # Whether to disable leader election.
50+
51+
metrics_addr: ":8080" # The address the metrics endpoint binds to.
52+
# The default value is ":8080".
53+
54+
enable_http2: false # Whether to enable HTTP/2 for the server.
55+
# The default value is false.
56+
57+
probe_addr: ":8081" # The address the probe endpoint binds to.
58+
# The default value is ":8081".
59+
60+
secure_metrics: false # The secure metrics configuration.
61+
# The default value is "" (empty).
62+
63+
exec_adc_timeout: 15s # The timeout for the ADC to execute.
64+
# The default value is 15 seconds.
65+
66+
provider:
67+
type: "api7ee" # Provider type.
68+
69+
sync_period: 0s # The period between two consecutive syncs.
70+
# The default value is 0 seconds, which means the controller will not sync.
71+
# If you want to enable the sync, set it to a positive value.
72+
init_sync_delay: 20m # The initial delay before the first sync, only used when the controller is started.
73+
# The default value is 20 minutes.
74+
```

docs/en/latest/reference/example.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ slug: /reference/apisix-ingress-controller/examples
44
description: Explore a variety of APISIX Ingress Controller configuration examples to help you customize settings to suit your environment effectively.
55
---
66

7+
<!--
8+
#
9+
# Licensed to the Apache Software Foundation (ASF) under one or more
10+
# contributor license agreements. See the NOTICE file distributed with
11+
# this work for additional information regarding copyright ownership.
12+
# The ASF licenses this file to You under the Apache License, Version 2.0
13+
# (the "License"); you may not use this file except in compliance with
14+
# the License. You may obtain a copy of the License at
15+
#
16+
# http://www.apache.org/licenses/LICENSE-2.0
17+
#
18+
# Unless required by applicable law or agreed to in writing, software
19+
# distributed under the License is distributed on an "AS IS" BASIS,
20+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
# See the License for the specific language governing permissions and
22+
# limitations under the License.
23+
#
24+
-->
25+
726
import Tabs from '@theme/Tabs';
827
import TabItem from '@theme/TabItem';
928

@@ -52,9 +71,10 @@ values={[
5271
apiVersion: gateway.networking.k8s.io/v1
5372
kind: GatewayClass
5473
metadata:
74+
namespace: ingress-apisix
5575
name: apisix
5676
spec:
57-
controllerName: "apisix.apache.org/apisix-ingress-controller"
77+
controllerName: "apisix.apache.org/apisix-ingress-controller" # 1
5878
---
5979
apiVersion: gateway.networking.k8s.io/v1
6080
kind: Gateway
@@ -66,14 +86,24 @@ spec:
6686
listeners:
6787
- name: http
6888
protocol: HTTP
69-
port: 80
89+
port: 80 # 2
7090
infrastructure:
7191
parametersRef:
72-
group: apisix.apache.org
73-
kind: GatewayProxy
74-
name: apisix-config
92+
group: apisix.apache.org # 3
93+
kind: GatewayProxy # 4
94+
name: apisix-config # 5
7595
```
7696
97+
❶ The controllerName field in GatewayClass needs to be customized if you are running multiple distinct instances of the APISIX Ingress Controller in the same cluster (not a single instance with multiple replicas). Each ingress controller instance must use a unique controllerName in its [configuration file](configuration-file.md), and the corresponding GatewayClass should reference that value.
98+
99+
❷ The `port` in the Gateway listener is required but ignored. This is due to limitations in the data plane: it cannot dynamically open new ports. Since the Ingress Controller does not manage the data plane deployment, it cannot automatically update the configuration or restart the data plane to apply port changes.
100+
101+
❸ API group of the referenced resource.
102+
103+
❹ Kind of the referenced resource.
104+
105+
❺ Name of the referenced resource. Should match the `metadata.name` of the GatewayProxy resource.
106+
77107
</TabItem>
78108

79109
<TabItem value="ingress">
@@ -102,6 +132,7 @@ spec:
102132
apiVersion: networking.k8s.io/v1
103133
kind: IngressClass
104134
metadata:
135+
namespace: ingress-apisix
105136
name: apisix
106137
spec:
107138
controller: apisix.apache.org/apisix-ingress-controller

0 commit comments

Comments
 (0)