Skip to content

Commit a47c8c6

Browse files
authored
docs: add config.yaml reference doc; explain a few parameters and gateway port being ignored (#2552)
1 parent bdbb3b9 commit a47c8c6

File tree

8 files changed

+225
-20
lines changed

8 files changed

+225
-20
lines changed

config/samples/config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
log_level: "info" # The log level of the APISIX Ingress Controller.
2-
# the default value is "info".
2+
# The default value is "info".
33

44
controller_name: apisix.apache.org/apisix-ingress-controller # The controller name of the APISIX Ingress Controller,
5-
# which is used to identify the controller in the GatewayClass.
6-
# The default value is "apisix.apache.org/apisix-ingress-controller".
7-
leader_election_id: "apisix-ingress-controller-leader" # The leader election ID for the APISIX Ingress Controller.
8-
# The default value is "apisix-ingress-controller-leader".
5+
# which is used to identify the controller in the GatewayClass.
6+
# The default value is "apisix.apache.org/apisix-ingress-controller".
7+
leader_election_id: "apisix-ingress-controller-leader" # The leader election ID for the APISIX Ingress Controller.
8+
# The default value is "apisix-ingress-controller-leader".
99
leader_election:
1010
lease_duration: 30s # lease_duration is the duration that non-leader candidates will wait
1111
# after observing a leadership renewal until attempting to acquire leadership of a
@@ -27,18 +27,18 @@ enable_http2: false # Whether to enable HTTP/2 for the serve
2727
probe_addr: ":8081" # The address the probe endpoint binds to.
2828
# The default value is ":8081".
2929

30-
secure_metrics: false # The secure metrics configuration.
30+
secure_metrics: false # The secure metrics configuration.
3131
# The default value is "" (empty).
3232

3333
exec_adc_timeout: 15s # The timeout for the ADC to execute.
3434
# The default value is 15 seconds.
3535

3636
provider:
37-
type: "apisix"
37+
type: "apisix" # Provider type.
38+
# Value can be "apisix" or "apisix-standalone".
3839

39-
sync_period: 1h
40-
# The period between two consecutive syncs.
40+
sync_period: 1h # The period between two consecutive syncs.
4141
# The default value is 1 hour, which means the controller will not sync.
4242
# If you want to enable the sync, set it to a positive value.
43-
init_sync_delay: 20m # The initial delay before the first sync, only used when the controller is started.
43+
init_sync_delay: 20m # The initial delay before the first sync, only used when the controller is started.
4444
# The default value is 20 minutes.

docs/en/latest/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"label": "Reference",
3939
"items": [
4040
"reference/api-reference",
41-
"reference/example"
41+
"reference/example",
42+
"reference/configuration-file"
4243
]
4344
},
4445
{

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: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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: "apisix" # Provider type.
68+
# Value can be "apisix" or "apisix-standalone".
69+
70+
sync_period: 1h # The period between two consecutive syncs.
71+
# The default value is 1 hour, which means the controller will not sync.
72+
# If you want to enable the sync, set it to a positive value.
73+
init_sync_delay: 20m # The initial delay before the first sync, only used when the controller is started.
74+
# The default value is 20 minutes.
75+
```

docs/en/latest/reference/example.md

Lines changed: 34 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

@@ -56,7 +75,7 @@ metadata:
5675
namespace: ingress-apisix
5776
name: apisix
5877
spec:
59-
controllerName: "apisix.apache.org/apisix-ingress-controller"
78+
controllerName: "apisix.apache.org/apisix-ingress-controller" # 1
6079
---
6180
apiVersion: gateway.networking.k8s.io/v1
6281
kind: Gateway
@@ -68,14 +87,24 @@ spec:
6887
listeners:
6988
- name: http
7089
protocol: HTTP
71-
port: 80
90+
port: 80 # 2
7291
infrastructure:
7392
parametersRef:
74-
group: apisix.apache.org
75-
kind: GatewayProxy
76-
name: apisix-config
93+
group: apisix.apache.org # 3
94+
kind: GatewayProxy # 4
95+
name: apisix-config # 5
7796
```
7897
98+
❶ 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.
99+
100+
❷ 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.
101+
102+
❸ API group of the referenced resource.
103+
104+
❹ Kind of the referenced resource.
105+
106+
❺ Name of the referenced resource. Should match the `metadata.name` of the GatewayProxy resource.
107+
79108
</TabItem>
80109

81110
<TabItem value="ingress">

0 commit comments

Comments
 (0)