Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: dump missing upstreams and routes #218

Open
NiuBlibing opened this issue Dec 17, 2024 · 1 comment
Open

Bug: dump missing upstreams and routes #218

NiuBlibing opened this issue Dec 17, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@NiuBlibing
Copy link

NiuBlibing commented Dec 17, 2024

Current Behavior

./adc dump --tls-skip-verify --verbose 2 -o service-configuration.yaml

generate empty output for upstreams and routes.
Debug log shown the server return upstreams and routes correctly.

[7:23:16 PM] [APISIX] › ⬤  debug     Get upstreams
GET https://10.0.0.1:9180/apisix/admin/upstreams
Accept: application/json, text/plain, */*
Content-Type: application/json
X-API-KEY: *****
User-Agent: axios/1.7.2
Accept-Encoding: gzip, compress, deflate, br

200 OK
Date: Tue, 17 Dec 2024 11:23:16 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: close
Server: APISIX/3.9.1
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: *
Access-Control-Max-Age: 3600
X-Api-Version: v3

{
    "total": 1,
    "list": [
        {
            "value": {
                "hash_on": "vars",
                "type": "roundrobin",
                "checks": {
                    "active": {
                        "https_verify_certificate": true,
                        "healthy": {
                            "http_statuses": [
                                200,
                                302
                            ],
                            "interval": 1,
                            "successes": 2
                        },
                        "type": "tcp",
                        "http_path": "/",
                        "unhealthy": {
                            "http_statuses": [
                                429,
                                404,
                                500,
                                501,
                                502,
                                503,
                                504,
                                505
                            ],
                            "http_failures": 5,
                            "tcp_failures": 2,
                            "timeouts": 3,
                            "interval": 1
                        },
                        "concurrency": 10,
                        "timeout": 1
                    }
                },
                "create_time": 1718966926,
                "id": "472184775684129492",
                "update_time": 1718966926,
                "keepalive_pool": {
                    "size": 320,
                    "idle_timeout": 60,
                    "requests": 1000
                },
                "nodes": [
                    {
                        "weight": 1,
                        "port": 80,
                        "priority": 0,
                        "host": "10.0.0.206"
                    },
                    {
                        "weight": 1,
                        "port": 80,
                        "priority": 0,
                        "host": "10.0.0.82"
                    }
                ],
                "pass_host": "pass",
                "scheme": "http",
                "name": "ocr-http",
                "timeout": {
                    "send": 6,
                    "connect": 6,
                    "read": 120
                }
            },
            "key": "/apisix/upstreams/472184775684129492",
            "createdIndex": 35,
            "modifiedIndex": 35
        }
    ]
}

Exxpected Behavior

Dump all upstreams and routes.

Steps to Reproduce

./adc dump --tls-skip-verify --verbose 2 -o service-configuration.yaml

Environment

  • APISIX version: 3.9.1
  • ADC version (run adc version): 0.16.2
  • Operating system (run uname -a): Linux manjaro 6.1.119-1-MANJARO x86_64 GNU/Linux
@NiuBlibing NiuBlibing added the bug Something isn't working label Dec 17, 2024
@bzp2010 bzp2010 added wontfix This will not be worked on and removed bug Something isn't working labels Dec 27, 2024
@bzp2010
Copy link
Collaborator

bzp2010 commented Dec 27, 2024

According to the description in the https://github.com/api7/adc/blob/main/libs/backend-apisix/README.md#the-output-of-dump-is-not-same-which-apache-apisix, this is what is expected. The current ADC design follows a fixed paradigm, and regardless of the backend, they all use a common YAML format. The flexible configuration format of APISIX prevents it from being fully structured and therefore cannot be converted to a configuration as is.

Instead, the requirement that routes must be associated to a service provides a more flexible model where you can configure upstream and shared plugin configurations for a batch of routes without the need to use plugin templates (plugin_config, which is in fact not a resource supported by the ADC; no need to worry about the inherent complexity in overriding the logic of prioritization-based overrides for plugin configurations).
This does not prevent certain features from being implemented, and therefore does not pose a barrier to scratch use.

Currently this is a fixed design and there are no ideas to change it for the time being, so this won't get improved straight away for a while. However, the APISIX exporter logic could be improved to allow more best-effort conversion of unorganized configurations.

This issue will remain open for more discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants