I am using official helm chart to install the APISIX in my Kubernetes. I only override the following values from the official helm chart:
- useDaemonSet-> true
- serviceAccount -> set
createto true and provide the saname - rbac.create -> true
- discovery -> set
enableto true and uncommentkubernetes:{}under registry - ssl -> set to true and provide the ca cert which is stored as tls secret in Kubernetes
- Dashboard -> set enable to true
Besides that, I am using all the default values in the official helm.
However, when I try to set a route, using Kubernetes as the discovery, and set my service (deployed in Kubernetes) as the upstream in the dashboard, I can't connect to it. The following error logs are shown:
2024/06/27 10:57:41 [error] 50#50: *8898 [lua] init.lua:548: handle_upstream(): failed to set upstream: no valid upstream node: nil, client: 10.0.2.15, server: _, request: "GET /alert/ HTTP/1.1", host: "10.152.183.66" 10.0.2.15 - - [27/Jun/2024:10:57:41 +0000] 10.152.183.66 "GET /alert/ HTTP/1.1" 503 269 0.000 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" - - - "http://10.152.183.66 I have a service created in Kubernetes default namespaces, and using the port 3000 I already set the upstream in the routes as default/my-service:3000
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE my-service ClusterIP 10.152.183.23 <none> 3000/TCP 7d7h But, it seems like apisix still cannot find the upstream service via kubernetes discovery.
Any ways to fix it?