|
| 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 | +``` |
0 commit comments