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: k8s dump api: /v1/discovery/kubernetes/dump return epndpoints null #11746

Open
zsmlinux opened this issue Nov 14, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@zsmlinux
Copy link

Current Behavior

discovery configuration:

    discovery:
      kubernetes:
        service:
          # apiserver schema, options [http, https]
          schema: https
          # apiserver host, options [ipv4, ipv6, domain, environment variable]
          host: ${KUBERNETES_SERVICE_HOST}

          # apiserver port, options [port number, environment variable]
          port: ${KUBERNETES_SERVICE_PORT}

        client:
          # serviceaccount token or token_file
          token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        default_weight: 50 # weight assigned to each discovered endpoint. default 50, minimum 0

        # kubernetes discovery support namespace_selector
        # you can use one of [equal, not_equal, match, not_match] filter namespace
        namespace_selector:
          # only save endpoints with namespace match one of [default, ^my-[a-z]+$]
          match:
          - ^[a-z]+$
          - alg

        # kubernetes discovery support label_selector
        # for the expression of label_selector, please refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
        #label_selector: |-
        #  first="a",second="b"

        # reserved lua shared memory size, 1m memory can store about 1000 pieces of endpoint
        shared_size: 20m #default 1m

        # if watch_endpoint_slices setting true, watch apiserver with endpointslices instead of endpoints
        # watch_endpoint_slices: true

When I curl dump api: curl http://127.0.0.1:9092/v1/discovery/kubernetes/dump, it return:

{"endpoints":{},"config":{"service":{"schema":"https","host":"${KUBERNETES_SERVICE_HOST}","port":"${KUBERNETES_SERVICE_PORT}"},"client":{"token_file":"/var/run/secrets/kubernetes.io/serviceaccount/token"},"namespace_selector":{"match":["^[a-z]+$","alg"]},"default_weight":50,"watch_endpoint_slices":false,"shared_size":"20m"}}

"endpoints":{}

I think some problems in it:
image

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

As above.

Environment

  • APISIX version (run apisix version): 3.10
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@dosubot dosubot bot added the bug Something isn't working label Nov 14, 2024
@zsmlinux
Copy link
Author

zsmlinux commented Nov 14, 2024

I have found dump api only support mutil-cluster mode, but not single-cluster mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant