zsmlinux opened a new issue, #11746:
URL: https://github.com/apache/apisix/issues/11746
### 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:
<img width="727" alt="image"
src="https://github.com/user-attachments/assets/c92c210d-9545-43cc-b976-494688ef7c4b">
### 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`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]