Skip to content

Commit bc2fe90

Browse files
authored
docs: add configuration troubleshooting reference docs (#2646)
1 parent ea34713 commit bc2fe90

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

docs/en/latest/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"items": [
4040
"reference/api-reference",
4141
"reference/example",
42+
"reference/troubleshoot",
4243
"reference/configuration-file",
4344
"reference/ingress-annotation"
4445
]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Configuration Troubleshooting
3+
slug: /reference/apisix-ingress-controller/configuration-troubleshoot
4+
description: Learn how to inspect and troubleshoot configuration translation and synchronization in APISIX Ingress Controller.
5+
---
6+
7+
Troubleshooting is required if the applied behavior does not match expectations, such as routes not being created correctly, plugins not being applied, or services failing to route traffic.
8+
9+
When you apply a Kubernetes resource—whether a Gateway API, Ingress, or APISIX CRD—the Ingress Controller translates it into ADC YAML, which is then applied to the gateway.
10+
11+
This document explains how to inspect the translated ADC configurations in memory and check the configurations actually applied to the gateway.
12+
13+
## Inspect Translated ADC Configurations
14+
15+
APISIX Ingress Controller provides a browser-accessible debug API that displays the translated ADC configurations, derived from the last applied Gateway API, Ingress, and APISIX CRD resources, in JSON format. It helps inspect the __in-memory state before the configurations are synchronized with the gateway__.
16+
17+
To use the debug API, configure these values in the ingress controller's [configuration file](./configuration-file.md):
18+
19+
```yaml title="config.yaml"
20+
enable_server: true # Enable the debug API server
21+
server_addr: "127.0.0.1:9092" # Server address
22+
```
23+
24+
These values are not yet available in the Helm chart. To apply the changes, modify the ConfigMap and restart the controller Deployment.
25+
26+
Once the debug API is enabled, you can access it by forwarding the controller pod’s port to your local machine:
27+
28+
```shell
29+
kubectl port-forward pod/<your-apisix-ingress-controller-pod-name> 9092:9092 &
30+
```
31+
32+
You can now access the debug API in browser at `127.0.0.1:9092/debug` and inspect the translated resources by resource type, such as routes and services.
33+
34+
## Inspect Synchronized Gateway Configurations
35+
36+
To inspect the configurations synchronized to the gateway, you can use the Admin API.
37+
38+
First, forward the Admin API's service port to your local machine:
39+
40+
```shell
41+
kubectl port-forward service/apisix-admin 9180:9180 &
42+
```
43+
44+
If you are using APISIX in standalone mode, you can send a request to `/apisix/admin/configs` to view all configurations synchronized to the gateway:
45+
46+
```shell
47+
curl "http://127.0.0.1:9180/apisix/admin/configs" -H "X-API-KEY: ${ADMIN_API_KEY}"
48+
```
49+
50+
If you are using APISIX with etcd, you can send a request to `/apisix/admin/<resource>` to view the synchronized configurations of specific resources. For instance, to view the route configuration:
51+
52+
```shell
53+
curl "http://127.0.0.1:9180/apisix/admin/routes" -H "X-API-KEY: ${ADMIN_API_KEY}"
54+
```
55+
56+
For reference, see [Admin API](https://apisix.apache.org/docs/apisix/admin-api/).

0 commit comments

Comments
 (0)